src/updatemanager.py
author Padraig O'Briain <padraig.obriain@sun.com>
Fri, 10 Jul 2009 19:54:19 +0100
changeset 1215 a302cf70ad94
parent 1209 640c256cb2a3
child 1217 1e2405e83d3a
permissions -rw-r--r--
9364 pm-updatemanager should support PKG_IMAGE
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     1
#!/usr/bin/python2.4
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     2
#
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     3
# CDDL HEADER START
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     4
#
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     5
# The contents of this file are subject to the terms of the
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     6
# Common Development and Distribution License (the "License").
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     7
# You may not use this file except in compliance with the License.
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     8
#
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
     9
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    10
# or http://www.opensolaris.org/os/licensing.
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    11
# See the License for the specific language governing permissions
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    12
# and limitations under the License.
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    13
#
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    14
# When distributing Covered Code, include this CDDL HEADER in each
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    15
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    16
# If applicable, add the following below this CDDL HEADER, with the
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    17
# fields enclosed by brackets "[]" replaced with your own identifying
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    18
# information: Portions Copyright [yyyy] [name of copyright owner]
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    19
#
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    20
# CDDL HEADER END
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    21
#
941
e7bff46da54e 6175 search needs to be moved to version 1
Brock Pytlik <bpytlik@sun.com>
parents: 927
diff changeset
    22
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    23
# Use is subject to license terms.
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    24
#
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    25
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    26
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    27
import getopt
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    28
import os
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    29
import sys
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    30
import time
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    31
import locale
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    32
import gettext
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    33
import pango
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    34
from threading import Thread
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    35
from threading import Timer
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    36
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    37
try:
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
    38
        import gnome
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    39
        import gobject
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    40
        gobject.threads_init()        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    41
        import gtk
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    42
        import gtk.glade
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    43
        import pygtk
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    44
        pygtk.require("2.0")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    45
except ImportError:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    46
        sys.exit(1)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    47
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    48
import pkg.client.image as image
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    49
import pkg.client.api as api
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    50
import pkg.client.api_errors as api_errors
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    51
import pkg.client.progress as progress
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    52
import pkg.gui.beadmin as beadm
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
    53
import pkg.gui.installupdate as installupdate
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
    54
import pkg.gui.enumerations as enumerations
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
    55
import pkg.gui.misc as gui_misc
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
    56
import pkg.misc as misc
696
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 660
diff changeset
    57
from pkg.client import global_settings
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    58
660
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
    59
# Put _() in the global namespace
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
    60
import __builtin__
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
    61
__builtin__._ = gettext.gettext
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
    62
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    63
IMAGE_DIRECTORY_DEFAULT = "/"   # Image default directory
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    64
IMAGE_DIR_COMMAND = "svcprop -p update/image_dir svc:/application/pkg/update"
942
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
    65
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
    66
ICON_LOCATION = "usr/share/package-manager/icons"
636
a8306e269861 4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents: 603
diff changeset
    67
PKG_CLIENT_NAME = "updatemanager" # API client name
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    68
SELECTION_CHANGE_LIMIT = 0.5    # Time limit in seconds to cancel selection updates
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    69
IND_DELAY = 0.05                # Time delay for printing index progress
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    70
UPDATES_FETCH_DELAY = 200       # Time to wait before fetching updates, allows gtk main
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    71
                                # loop time to start and display main UI
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    72
#UM Row Model
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    73
(
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    74
UM_ID,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    75
UM_INSTALL_MARK,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    76
UM_STATUS,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    77
UM_NAME,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    78
UM_REBOOT,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    79
UM_LATEST_VER,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    80
UM_SIZE,
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
    81
UM_STEM,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    82
) = range(8)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    83
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    84
class Updatemanager:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    85
        def __init__(self):
696
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 660
diff changeset
    86
                global_settings.client_name = PKG_CLIENT_NAME
6bbfd2dece6f 4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents: 660
diff changeset
    87
                    
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    88
                try:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    89
                        self.application_dir = os.environ["UPDATE_MANAGER_ROOT"]
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    90
                except KeyError:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    91
                        self.application_dir = "/"
791
123e9401e939 5778 Inability to set locale leads to stack trace
Danek Duvall <danek.duvall@sun.com>
parents: 771
diff changeset
    92
                misc.setlocale(locale.LC_ALL, "")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    93
                for module in (gettext, gtk.glade):
1137
f6c7c39981aa 8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1136
diff changeset
    94
                        module.bindtextdomain("pkg", os.path.join(
f6c7c39981aa 8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1136
diff changeset
    95
                            self.application_dir,
f6c7c39981aa 8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1136
diff changeset
    96
                            "usr/share/locale"))
660
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
    97
                        module.textdomain("pkg")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    98
                # Duplicate ListStore setup in get_updates_to_list()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
    99
                self.um_list = \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   100
                    gtk.ListStore(
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   101
                        gobject.TYPE_INT,         # UM_ID
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   102
                        gobject.TYPE_BOOLEAN,     # UM_INSTALL_MARK
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   103
                        gtk.gdk.Pixbuf,           # UM_STATUS
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   104
                        gobject.TYPE_STRING,      # UM_NAME
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   105
                        gtk.gdk.Pixbuf,           # UM_REBOOT
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   106
                        gobject.TYPE_STRING,      # UM_LATEST_VER
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   107
                        gobject.TYPE_STRING,      # UM_SIZE
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   108
                        gobject.TYPE_STRING,      # UM_STEM                        
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   109
                        )
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   110
                self.progress_stop_thread = False
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   111
                self.last_select_time = 0
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   112
                self.fmri_description = None
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   113
                self.image_dir_arg = None
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   114
                self.toggle_counter = 0
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   115
                self.selection_timer = None
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   116
                self.package_selection = None
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   117
                self.update_all_proceed = False
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   118
                self.ua_be_name = None
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   119
                self.application_path = None
1164
978947aae45f 9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1148
diff changeset
   120
                self.icon_theme = gtk.IconTheme()
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   121
                icon_location = os.path.join(self.application_dir, ICON_LOCATION)
1164
978947aae45f 9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1148
diff changeset
   122
                self.icon_theme.append_search_path(ICON_LOCATION)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   123
                self.ua_start = 0
997
4c5d85a87ea2 7791 Exception in updatemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 985
diff changeset
   124
                self.pylintstub = None
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   125
                self.api_obj = None
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   126
                self.release_notes_url = "http://www.opensolaris.org"
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   127
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   128
                # Progress Dialog
1137
f6c7c39981aa 8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1136
diff changeset
   129
                self.gladefile = os.path.join(self.application_dir,
f6c7c39981aa 8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1136
diff changeset
   130
                    "usr/share/update-manager/updatemanager.glade")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   131
                w_xmltree_progress = gtk.glade.XML(self.gladefile, "progressdialog")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   132
                self.w_progress_dialog = w_xmltree_progress.get_widget("progressdialog")
1103
04e93a722692 8564 Pressing Esc in Adding New Repository dialog should cancel the addition
John Rice <john.rice@sun.com>
parents: 1096
diff changeset
   133
                self.w_progress_dialog.connect('delete-event', lambda stub1, stub2: True)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   134
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   135
                self.w_progressinfo_label = w_xmltree_progress.get_widget("progressinfo")
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   136
                self.w_progressinfo_separator = w_xmltree_progress.get_widget(
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   137
                    "progressinfo_separator")                
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   138
                self.w_progressinfo_expander = \
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   139
                    w_xmltree_progress.get_widget("progressinfo_expander")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   140
                self.w_progressinfo_textview = \
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   141
                    w_xmltree_progress.get_widget("progressinfo_textview")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   142
                infobuffer = self.w_progressinfo_textview.get_buffer()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   143
                infobuffer.create_tag("bold", weight=pango.WEIGHT_BOLD)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   144
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   145
                self.w_progress_install_vbox = \
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   146
                    w_xmltree_progress.get_widget("progress_install_vbox")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   147
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   148
                self.w_progress_closeon_finish_chk = \
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   149
                    w_xmltree_progress.get_widget("closeon_finish_checkbutton")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   150
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   151
                self.w_progress_cancel = w_xmltree_progress.get_widget("progresscancel")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   152
                self.w_progress_ok = w_xmltree_progress.get_widget("progressok")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   153
                self.w_progressbar = w_xmltree_progress.get_widget("progressbar")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   154
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   155
                # UM Dialog
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   156
                w_xmltree_um = gtk.glade.XML(self.gladefile, "um_dialog")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   157
                self.w_um_dialog = w_xmltree_um.get_widget("um_dialog")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   158
                self.w_um_dialog.connect("destroy", self.__on_um_dialog_close)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   159
                self.w_um_intro_label = w_xmltree_um.get_widget("um_intro_label")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   160
                self.w_um_install_button = w_xmltree_um.get_widget("um_install_button")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   161
                self.w_um_updateall_button = \
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   162
                    w_xmltree_um.get_widget("um_updateall_button")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   163
                self.w_um_expander = w_xmltree_um.get_widget("um_expander")
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   164
                self.w_um_expander.set_expanded(True)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   165
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   166
                self.w_progress_dialog.set_transient_for(self.w_um_dialog)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   167
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   168
                self.w_um_treeview = w_xmltree_um.get_widget("um_treeview")  
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   169
                self.w_um_textview = w_xmltree_um.get_widget("um_textview")  
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   170
                infobuffer = self.w_um_textview.get_buffer()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   171
                infobuffer.create_tag("bold", weight=pango.WEIGHT_BOLD)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   172
                self.w_select_checkbox = w_xmltree_um.get_widget("selectall_checkbutton")
985
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   173
                self.w_um_cancel_button = w_xmltree_um.get_widget("cancel_button")
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   174
                self.w_um_close_button = w_xmltree_um.get_widget("close_button")
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   175
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   176
                # UM Completed Dialog
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   177
                w_xmltree_um_completed = gtk.glade.XML(self.gladefile, 
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   178
                    "um_completed_dialog")
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   179
                self.w_um_completed_dialog = w_xmltree_um_completed.get_widget(
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   180
                    "um_completed_dialog")
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   181
                self.w_um_completed_dialog .connect("destroy", self.__on_um_dialog_close)
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   182
                self.w_um_completed_time_label = w_xmltree_um_completed.get_widget(
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   183
                    "um_completed_time_label")
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   184
                self.w_um_completed_release_label = w_xmltree_um_completed.get_widget(
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   185
                    "um_completed_release_label")
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   186
                self.w_um_completed_linkbutton = w_xmltree_um_completed.get_widget(
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   187
                    "um_completed_linkbutton")
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   188
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   189
                self.details_cache = {}
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   190
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   191
                try:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   192
                        dic = \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   193
                            {
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   194
                                "on_um_dialog_close": \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   195
                                    self.__on_um_dialog_close,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   196
                                "on_cancel_button_clicked": \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   197
                                    self.__on_cancel_button_clicked,
985
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   198
                                "on_close_button_clicked": \
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   199
                                    self.__on_cancel_button_clicked,
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   200
                                "on_help_button_clicked": \
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   201
                                    self.__on_help_button_clicked,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   202
                                "on_um_updateall_button_clicked": \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   203
                                    self.__on_updateall_button_clicked,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   204
                                "on_um_expander_activate": \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   205
                                    self.__on_um_expander_activate,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   206
                                "on_selectall_checkbutton_toggled": \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   207
                                    self.__on_selectall_checkbutton_toggled,
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   208
                            }
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   209
                        w_xmltree_um.signal_autoconnect(dic)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   210
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   211
                        dic_completed = \
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   212
                            {
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   213
                                "on_um_complete_close_button_clicked": \
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   214
                                     self.__on_um_dialog_close,
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   215
                                "on_um_completed_linkbutton_clicked": \
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   216
                                     self.__on_um_completed_linkbutton_clicked,
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   217
                                     
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   218
                            }
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   219
                        w_xmltree_um_completed.signal_autoconnect(dic_completed)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   220
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   221
                except AttributeError, error:
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   222
                        print _("GUI will not respond to any event! %s. "
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   223
                            "Check updatemanager.py signals") % error
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   224
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   225
                self.pr = progress.NullProgressTracker()
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   226
 
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   227
                self.w_um_dialog.show_all()
997
4c5d85a87ea2 7791 Exception in updatemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 985
diff changeset
   228
                self.w_um_dialog.resize(620, 500)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   229
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   230
        def __set_cancel_state(self, status):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   231
                if status:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   232
                        gobject.idle_add(self.w_progress_cancel.grab_focus)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   233
                gobject.idle_add(self.w_progress_cancel.set_sensitive, status)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   234
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   235
        def __set_initial_selection(self):
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   236
                self.__selectall_toggle(True)
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   237
                if len(self.um_list) == 0:
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   238
                        self.__display_noupdates()
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   239
                else:
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   240
                        self.w_um_treeview.set_cursor(0, None)
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   241
                        if self.update_all_proceed:
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   242
                                self.__on_updateall_button_clicked(None)
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   243
                                self.update_all_proceed = False
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   244
                        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   245
        def __mark_cell_data_default_function(self, column, renderer, model, itr, data):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   246
                if itr:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   247
                        if model.get_value(itr, UM_STATUS) != None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   248
                                self.__set_renderer_active(renderer, False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   249
                        else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   250
                                self.__set_renderer_active(renderer, True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   251
                                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   252
        @staticmethod
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   253
        def __set_renderer_active(renderer, active):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   254
                if active:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   255
                        renderer.set_property("sensitive", True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   256
                        renderer.set_property("mode", gtk.CELL_RENDERER_MODE_ACTIVATABLE)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   257
                else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   258
                        renderer.set_property("sensitive", False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   259
                        renderer.set_property("mode", gtk.CELL_RENDERER_MODE_INERT)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   260
                
1204
0d3de1d0a4d8 9833 updatemanager dialog icon is missing after upgrading Desktop packages
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1168
diff changeset
   261
        def __get_icon_pixbuf(self, icon_name, size=16):
0d3de1d0a4d8 9833 updatemanager dialog icon is missing after upgrading Desktop packages
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1168
diff changeset
   262
                return gui_misc.get_icon(self.icon_theme, icon_name, size)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   263
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   264
        def __get_selected_fmris(self):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   265
                model = self.w_um_treeview.get_model()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   266
                iter_next = model.get_iter_first()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   267
                list_of_selected_fmris = []
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   268
                while iter_next != None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   269
                        if model.get_value(iter_next, UM_INSTALL_MARK):
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   270
                                list_of_selected_fmris.append(model.get_value(iter_next,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   271
                                    UM_NAME))
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   272
                        iter_next = model.iter_next(iter_next)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   273
                return list_of_selected_fmris
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   274
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   275
        def init_tree_views(self):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   276
                model = self.w_um_treeview.get_model()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   277
                toggle_renderer = gtk.CellRendererToggle()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   278
                toggle_renderer.connect('toggled', self.__active_pane_toggle, model)
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   279
                column = gtk.TreeViewColumn("", toggle_renderer,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   280
                    active = UM_INSTALL_MARK)
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   281
                column.set_cell_data_func(toggle_renderer,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   282
                    self.__mark_cell_data_default_function, None)                    
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   283
                toggle_renderer.set_property("activatable", True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   284
                column.set_expand(False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   285
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   286
                # Show Cancel, Update All only
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   287
                self.w_select_checkbox.hide()
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   288
                self.w_um_install_button.hide()
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   289
                self.w_um_intro_label.set_text(_(
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   290
                    "Updates are available for the following packages.\n"
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   291
                    "Click Update All to create a new boot environment and "
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   292
                    "install all packages into it."))
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   293
                        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   294
                render_pixbuf = gtk.CellRendererPixbuf()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   295
                column = gtk.TreeViewColumn()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   296
                column.pack_start(render_pixbuf, expand = False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   297
                column.add_attribute(render_pixbuf, "pixbuf", UM_STATUS)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   298
                column.set_title("   ")
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   299
                # Hiding Status column for now
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   300
                #self.w_um_treeview.append_column(column)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   301
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   302
                name_renderer = gtk.CellRendererText()
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   303
                column = gtk.TreeViewColumn(_("Name"), name_renderer,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   304
                    text = UM_NAME)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   305
                column.set_cell_data_func(name_renderer, self.__cell_data_function, None)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   306
                column.set_expand(True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   307
                self.w_um_treeview.append_column(column)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   308
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   309
                column = gtk.TreeViewColumn()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   310
                render_pixbuf = gtk.CellRendererPixbuf()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   311
                column.pack_start(render_pixbuf, expand = True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   312
                column.add_attribute(render_pixbuf, "pixbuf", UM_REBOOT)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   313
                # Hiding Reboot required column for now
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   314
                # self.w_um_treeview.append_column(column)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   315
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   316
                version_renderer = gtk.CellRendererText()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   317
                version_renderer.set_property('xalign', 0.0)
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   318
                column = gtk.TreeViewColumn(_("Latest Version"), version_renderer,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   319
                    text = UM_LATEST_VER) 
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   320
                column.set_cell_data_func(version_renderer,
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   321
                    self.__cell_data_function, None)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   322
                column.set_expand(True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   323
                self.w_um_treeview.append_column(column)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   324
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   325
                size_renderer = gtk.CellRendererText()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   326
                size_renderer.set_property('xalign', 0.0)
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   327
                column = gtk.TreeViewColumn(_("Size (Meg)"), size_renderer,
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   328
                    text = UM_SIZE)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   329
                column.set_cell_data_func(size_renderer, self.__cell_data_function, None)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   330
                column.set_expand(True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   331
                # XXX Hiding Size as it takes too long to fetch at the minute
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   332
                #self.w_um_treeview.append_column(column)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   333
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   334
                #Added selection listener
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   335
                self.package_selection = self.w_um_treeview.get_selection()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   336
                self.package_selection.set_mode(gtk.SELECTION_SINGLE)
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   337
                self.package_selection.connect("changed",
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   338
                    self.__on_package_selection_changed, None)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   339
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   340
                # Setup Icons
1204
0d3de1d0a4d8 9833 updatemanager dialog icon is missing after upgrading Desktop packages
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1168
diff changeset
   341
                self.w_um_dialog.set_icon(self.__get_icon_pixbuf("UM_package", 36))
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   342
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   343
        def __get_image_path(self):
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   344
                '''This function gets the image path or the default'''
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   345
                if self.image_dir_arg != None:
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   346
                        return self.image_dir_arg
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   347
1215
a302cf70ad94 9364 pm-updatemanager should support PKG_IMAGE
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1209
diff changeset
   348
                try:
a302cf70ad94 9364 pm-updatemanager should support PKG_IMAGE
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1209
diff changeset
   349
                        image_directory = os.environ["PKG_IMAGE"]
a302cf70ad94 9364 pm-updatemanager should support PKG_IMAGE
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1209
diff changeset
   350
                except KeyError:
a302cf70ad94 9364 pm-updatemanager should support PKG_IMAGE
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1209
diff changeset
   351
                        image_directory = \
a302cf70ad94 9364 pm-updatemanager should support PKG_IMAGE
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1209
diff changeset
   352
                            os.popen(IMAGE_DIR_COMMAND).readline().rstrip()
a302cf70ad94 9364 pm-updatemanager should support PKG_IMAGE
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1209
diff changeset
   353
                        if len(image_directory) == 0:
a302cf70ad94 9364 pm-updatemanager should support PKG_IMAGE
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1209
diff changeset
   354
                                image_directory = IMAGE_DIRECTORY_DEFAULT
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   355
                return image_directory
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   356
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   357
        def get_updates_to_list(self):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   358
                '''This function fetches a list of the updates
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   359
                        that are available to list'''
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   360
                # MUST match self.um_list ListStore setup in __init__
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   361
                um_list = \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   362
                    gtk.ListStore(
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   363
                        gobject.TYPE_INT,         # UM_ID
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   364
                        gobject.TYPE_BOOLEAN,     # UM_INSTALL_MARK
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   365
                        gtk.gdk.Pixbuf,           # UM_STATUS
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   366
                        gobject.TYPE_STRING,      # UM_NAME
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   367
                        gtk.gdk.Pixbuf,           # UM_REBOOT
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   368
                        gobject.TYPE_STRING,      # UM_LATEST_VER
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   369
                        gobject.TYPE_STRING,      # UM_SIZE
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   370
                        gobject.TYPE_STRING,      # UM_STEM                        
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   371
                        )
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   372
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   373
                self.api_obj = self.__get_api_obj()
1168
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   374
                image_obj = self.api_obj.img
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   375
                #TODO: This part is required so misc.get_inventory_list
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   376
                #      is returning desired list of packages.
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   377
                #      After the list api (bug #5872) is in place
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   378
                #      this part should be replaced.
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   379
                image_obj.load_catalogs(self.pr)
1168
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   380
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   381
                count = 0
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   382
                pkg_upgradeable = None
1168
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   383
                for pkg, state in sorted(misc.get_inventory_list(
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   384
                    image_obj, [], all_known = True, all_versions = False)):
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   385
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   386
                        while gtk.events_pending():
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   387
                                gtk.main_iteration(False)
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   388
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   389
                        if state["upgradable"] and state["state"] == "installed":
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   390
                                pkg_upgradeable = pkg
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   391
                        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   392
                        # Allow testing by listing uninstalled packages, -u option
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   393
                        add_package = False
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   394
                        if pkg_upgradeable != None and not state["upgradable"]:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   395
                                if list_uninstalled:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   396
                                        add_package = not \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   397
                                        image_obj.fmri_is_same_pkg(pkg_upgradeable, pkg)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   398
                                else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   399
                                        add_package = \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   400
                                        image_obj.fmri_is_same_pkg(pkg_upgradeable, pkg)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   401
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   402
                        if add_package:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   403
                                count += 1
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   404
                                # XXX: Would like to caputre if package for upgrade is
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   405
                                # incorporated, could then indicate this to user
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   406
                                # and take action when doing install to run image-update.
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   407
                                #if state["incorporated"]:
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   408
                                #        incState = _("Inc")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   409
                                #else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   410
                                #        incState = "--"
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   411
                                pkg_name = gui_misc.get_pkg_name(pkg.get_name())
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   412
                                um_list.insert(count, [count, False, None,
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   413
                                    pkg_name, None, pkg.get_version(), None,
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   414
                                    pkg.get_pkg_stem()])
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   415
                                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   416
                if debug:
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   417
                        print _("count: %d") % count
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   418
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   419
                self.progress_stop_thread = True
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   420
                gobject.idle_add(self.w_um_treeview.set_model, um_list)
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   421
                self.um_list = um_list                
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   422
                gobject.idle_add(self.__set_initial_selection)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   423
                        
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   424
                # XXX: Currently this will fetch the sizes but it really slows down the
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   425
                # app responsiveness - until we get caching I think we should just hide
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   426
                # the size column
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   427
                # gobject.timeout_add(1000, self.__setup_sizes)
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   428
                
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   429
        def __get_api_obj(self):
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   430
                if self.api_obj == None:
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   431
                        self.api_obj = gui_misc.get_api_object(self.__get_image_path(),
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   432
                            progress.NullProgressTracker(), self.w_um_dialog)
1168
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   433
                return self.api_obj
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   434
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   435
        def __display_noupdates(self):
942
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   436
                self.w_um_intro_label.set_markup(_("<b>No Updates available.</b>"))
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   437
                self.w_um_treeview.hide()
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   438
                self.w_um_expander.hide()
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   439
                self.w_um_install_button.set_sensitive(False)
985
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   440
                self.w_um_updateall_button.hide()
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   441
                self.w_um_cancel_button.hide()
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   442
                self.w_um_close_button.show()
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   443
                self.w_select_checkbox.set_active(False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   444
                self.w_select_checkbox.set_sensitive(False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   445
                self.w_um_dialog.present()
997
4c5d85a87ea2 7791 Exception in updatemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 985
diff changeset
   446
                self.w_um_dialog.resize(420, 100)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   447
                
860
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   448
        def __get_info_from_name(self, name, local):
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   449
                if self.fmri_description != name:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   450
                        return None
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   451
                if self.__get_api_obj() == None:
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   452
                        return None
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   453
                        
917
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 869
diff changeset
   454
                ret = self.__get_api_obj().info([name], local,
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 869
diff changeset
   455
                    (api.PackageInfo.ALL_OPTIONS -
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 869
diff changeset
   456
                    frozenset([api.PackageInfo.LICENSES])) -
eed22f430a9f 6902 api.info needs a "fast" flag or a way to pass a set of the information required
Brock Pytlik <bpytlik@sun.com>
parents: 869
diff changeset
   457
                    api.PackageInfo.ACTION_OPTIONS)
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   458
                
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   459
                pis = ret[api.ImageInterface.INFO_FOUND]
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   460
                if len(pis) == 1:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   461
                        return pis[0]
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   462
                else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   463
                        return None
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   464
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   465
        def __get_details_from_name(self, name):                        
860
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   466
                info = self.__get_info_from_name(name, False)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   467
                if info is not None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   468
                        return self.__update_details_from_info(name, info)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   469
                else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   470
                        return None
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   471
                        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   472
        def __update_details_from_info(self, name, info):
860
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   473
                local_info = self.__get_info_from_name(name, True)
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   474
                categories = _("None")
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   475
                if info.category_info_list:
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   476
                        verbose = len(info.category_info_list) > 1
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   477
                        categories = ""
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   478
                        categories += info.category_info_list[0].__str__(verbose)
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   479
                        if len(info.category_info_list) > 1:
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   480
                                for ci in info.category_info_list[1:]:
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   481
                                        categories += ", " + ci.__str__(verbose)
942
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   482
                try:
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   483
                        installed_ver = "%s-%s" % (local_info.version, local_info.branch)
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   484
                except AttributeError:
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   485
                        installed_ver = ""
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   486
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   487
                ver = "%s-%s" % (info.version, info.branch)
860
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   488
                summary = _("None")
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   489
                if info.summary:
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   490
                        summary = info.summary
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   491
 
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   492
                str_details = _(
860
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   493
                    '\nSummary:\t\t\t%s'
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   494
                    '\nSize:       \t\t\t%s'
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   495
                    '\nCategory:\t\t\t%s'
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   496
                    '\nLatest Version:\t\t%s'
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   497
                    '\nInstalled Version:\t%s'
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   498
                    '\nPackaging Date:\t%s'
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   499
                    '\nFMRI:       \t\t\t%s'
962
d7897f87708d 7488 Information about publisher needed in GUI
Padraig O'Briain <padraig.obriain@sun.com>
parents: 942
diff changeset
   500
                    '\nRepository:       \t\t%s'
860
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   501
                    '\n') \
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   502
                    % (summary, misc.bytes_to_str(info.size), 
5c86e593ed4d 5168 UM listing details incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents: 809
diff changeset
   503
                    categories, ver, installed_ver,
962
d7897f87708d 7488 Information about publisher needed in GUI
Padraig O'Briain <padraig.obriain@sun.com>
parents: 942
diff changeset
   504
                    info.packaging_date, info.fmri, info.publisher)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   505
                self.details_cache[name] = str_details
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   506
                return str_details
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   507
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   508
        @staticmethod
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   509
        def __removed_filter(model, itr):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   510
                '''This function filters category in the main application view'''
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   511
                return True
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   512
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   513
        def __on_package_selection_changed(self, selection, widget):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   514
                '''This function is for handling package selection changes'''
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   515
                model, itr = selection.get_selected()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   516
                if itr:                        
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   517
                        fmri = model.get_value(itr, UM_STEM)
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   518
                        pkg_name =  model.get_value(itr, UM_NAME)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   519
                        delta = time.time() - self.last_select_time
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   520
                        if delta < SELECTION_CHANGE_LIMIT:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   521
                                if self.selection_timer is not None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   522
                                        self.selection_timer.cancel()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   523
                                        self.selection_timer = None
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   524
                        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   525
                        self.fmri_description = fmri
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   526
                        self.last_select_time = time.time()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   527
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   528
                        if self.details_cache.has_key(fmri):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   529
                                if self.selection_timer is not None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   530
                                        self.selection_timer.cancel()  
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   531
                                        self.selection_timer = None
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   532
                                infobuffer = self.w_um_textview.get_buffer()
660
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
   533
                                infobuffer.set_text("")
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
   534
                                textiter = infobuffer.get_end_iter()
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   535
                                infobuffer.insert_with_tags_by_name(textiter,
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   536
                                    "\n%s" % pkg_name, "bold")
660
ea2809ad4582 4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents: 653
diff changeset
   537
                                infobuffer.insert(textiter, self.details_cache[fmri])
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   538
                        else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   539
                                infobuffer = self.w_um_textview.get_buffer()
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   540
                                infobuffer.set_text(
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   541
                                    _("\nFetching details for %s ...") % pkg_name)
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   542
                                self.selection_timer = Timer(SELECTION_CHANGE_LIMIT,
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   543
                                    self.__show_package_info_thread,
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   544
                                    args=(fmri, pkg_name )).start()
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   545
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   546
        def __show_package_info_thread(self, fmri, pkg_name):
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   547
                Thread(target = self.__show_package_info,
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   548
                    args = (fmri, pkg_name)).start()
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   549
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   550
        def __show_package_info(self, fmri, pkg_name):
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   551
                details = self.__get_details_from_name(fmri)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   552
                if self.fmri_description == fmri and details != None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   553
                        infobuffer = self.w_um_textview.get_buffer()
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   554
                        infobuffer.set_text("")
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   555
                        textiter = infobuffer.get_end_iter()
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   556
                        infobuffer.insert_with_tags_by_name(textiter,
1031
5c130cc07e44 7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1024
diff changeset
   557
                            "\n%s" % pkg_name, "bold")
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   558
                        infobuffer.insert(textiter, details)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   559
                elif self.fmri_description == fmri and details == None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   560
                        infobuffer = self.w_um_textview.get_buffer()
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   561
                        infobuffer.set_text("")
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   562
                        textiter = infobuffer.get_end_iter()
942
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   563
                        if textiter != None: #Gtk race condition seems to cause this
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   564
                                infobuffer.insert_with_tags_by_name(textiter,
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   565
                                        _("\nNo details available"), "bold")
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   566
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   567
        def __on_um_completed_linkbutton_clicked(self, widget):
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   568
                try:
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   569
                        gnome.url_show(self.release_notes_url)
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   570
                except gobject.GError:
1168
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   571
                        gui_misc.error_occurred(self.w_um_dialog,
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   572
                            _("Unable to navigate to:\n\t%s") % 
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   573
                            self.release_notes_url,
6ca02b55d252 5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1164
diff changeset
   574
                            msg_title=_("Update Manager"))
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   575
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   576
        def __on_um_dialog_close(self, widget):
600
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   577
                self.__exit_app()
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   578
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   579
        def __on_cancel_button_clicked(self, widget):
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   580
                self.__exit_app()
985
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   581
                
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   582
        def __on_help_button_clicked(self, widget):
bcc30bb98888 5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents: 962
diff changeset
   583
                gui_misc.display_help(self.application_dir, "um_info")
600
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   584
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   585
        def __exit_app(self, be_name = None):
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   586
                if be_name:
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   587
                        if self.image_dir_arg:
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   588
                                gobject.spawn_async([self.application_path, "-R",
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   589
                                    self.image_dir_arg, "-U", be_name])
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   590
                        else:
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   591
                                gobject.spawn_async([self.application_path, 
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   592
                                    "-U", be_name])
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   593
796
bcd90655ad83 4019 Package Manager close bug
Padraig O'Briain <padraig.obriain@sun.com>
parents: 791
diff changeset
   594
                self.w_um_dialog.hide()
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   595
                gtk.main_quit()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   596
                sys.exit(0)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   597
                return True
600
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   598
        
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   599
        def restart_after_ips_update(self, be_name):
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   600
                self.__exit_app(be_name)
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   601
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   602
        def __on_updateall_button_clicked(self, widget):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   603
                self.__selectall_toggle(True)
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   604
                self.__get_api_obj().reset()
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   605
                self.ua_start = time.time()
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   606
                installupdate.InstallUpdate([], self,
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   607
                    self.api_obj, ips_update = False,
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   608
                    action = enumerations.IMAGE_UPDATE,
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   609
                    be_name = self.ua_be_name,
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   610
                    parent_name = _("Update Manager"),
1124
6cbf082b5bf4 8882 exception during upgrade with update manager gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1103
diff changeset
   611
                    pkg_list = ["SUNWipkg", "SUNWipkg-gui", "SUNWipkg-um"],
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   612
                    main_window = self.w_um_dialog,
1204
0d3de1d0a4d8 9833 updatemanager dialog icon is missing after upgrading Desktop packages
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1168
diff changeset
   613
                    icon_confirm_dialog = self.__get_icon_pixbuf("UM_package", 36))
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   614
                return
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   615
               
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   616
        def __on_selectall_checkbutton_toggled(self, widget):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   617
                self.__selectall_toggle(widget.get_active())
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   618
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   619
        def __display_update_image_success(self):
1136
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   620
                elapsed_sec = int(time.time() - self.ua_start)
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   621
                elapsed_min = elapsed_sec / 60
600
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   622
                info_str = ""
1136
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   623
                if elapsed_sec >= 120:
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   624
                        info_str = _(
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   625
                           "Update All finished successfully in %d minutes.") \
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   626
                           % elapsed_min
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   627
                else:
1136
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   628
                        info_str = _(
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   629
                            "Update All finished successfully in %d seconds.") \
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   630
                             % elapsed_sec
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   631
                self.w_um_completed_time_label.set_text(info_str)
600
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   632
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   633
                info_str = _(
1136
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   634
                    "Review the posted release notes before rebooting your system:"
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   635
                    )
1136
27b3bc1f4768 8505 minor messaging fixups in gui
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1124
diff changeset
   636
                self.w_um_completed_release_label.set_text(info_str)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   637
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   638
                info_str = misc.get_release_notes_url()
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   639
                self.w_um_completed_linkbutton.set_uri(info_str)
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   640
                self.w_um_completed_linkbutton.set_label(info_str)
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   641
                self.release_notes_url = info_str
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   642
                
600
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   643
                self.w_um_dialog.hide()
1023
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   644
                self.w_um_completed_dialog.set_title(_("Update All Completed"))
73f73773b4c9 6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents: 997
diff changeset
   645
                self.w_um_completed_dialog.show()
600
dc1db5978b68 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 597
diff changeset
   646
                
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   647
        def __handle_cancel_exception(self):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   648
                gobject.idle_add(self.w_progress_dialog.hide)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   649
                gobject.idle_add(self.w_progressinfo_expander.set_expanded, False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   650
                self.__cleanup()                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   651
        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   652
        def __prompt_to_load_beadm(self):
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   653
                msgbox = gtk.MessageDialog(parent = self.w_progress_dialog,
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   654
                    buttons = gtk.BUTTONS_OK_CANCEL, flags = gtk.DIALOG_MODAL,
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   655
                    type = gtk.MESSAGE_ERROR,
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   656
                    message_format = _(
942
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   657
                    "Not enough disc space, the Update All action cannot "
771
24696e0e0a92 5175 Wrong spacing in the updatemanager.py
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 731
diff changeset
   658
                    "be performed.\n\n"
942
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   659
                    "Click OK to manage your existing BEs and free up disk space or "
cb2774668721 6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents: 941
diff changeset
   660
                    "Cancel to cancel Update All."))
808
6c89385ac9ff 4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents: 796
diff changeset
   661
                msgbox.set_title(_("Not Enough Disc Space"))
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   662
                result = msgbox.run()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   663
                msgbox.destroy()
597
7c6e4f5a442a 3981 UpdateManager UI Spec review and adjustments
John Rice <john.rice@sun.com>
parents: 578
diff changeset
   664
                if result == gtk.RESPONSE_OK:
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   665
                        gobject.idle_add(self.__create_beadm)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   666
                        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   667
        def __create_beadm(self):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   668
                self.gladefile = \
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   669
                        "/usr/share/package-manager/packagemanager.glade"
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   670
                beadm.Beadmin(self)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   671
                return False
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   672
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   673
        @staticmethod
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   674
        def __unique(list1, list2):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   675
                """Return a list containing all items
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   676
                        in 'list1' that are not in 'list2'"""
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   677
                list2 = dict([(k, None) for k in list2])
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   678
                return [item for item in list1 if item not in list2]
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   679
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   680
        def __cleanup(self):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   681
                self.api_obj.reset()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   682
                self.pr.reset()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   683
                self.progress_stop_thread = True   
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   684
                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   685
        @staticmethod
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   686
        def __on_um_expander_activate(widget):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   687
                return
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   688
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   689
        def __selectall_toggle(self, select):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   690
                for row in self.um_list:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   691
                        row[UM_INSTALL_MARK] = select
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   692
                if select:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   693
                        self.toggle_counter += len(self.um_list)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   694
                        self.w_um_install_button.set_sensitive(True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   695
                else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   696
                        self.toggle_counter = 0
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   697
                        self.w_um_install_button.set_sensitive(False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   698
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   699
        def __active_pane_toggle(self, cell, filtered_path, filtered_model):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   700
                model = self.w_um_treeview.get_model()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   701
                itr = model.get_iter(filtered_path)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   702
                if itr:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   703
                        installed = model.get_value(itr, UM_STATUS)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   704
                        if installed is None:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   705
                                modified = model.get_value(itr, UM_INSTALL_MARK)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   706
                                model.set_value(itr, UM_INSTALL_MARK, not modified)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   707
                        if not modified:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   708
                                self.toggle_counter += 1
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   709
                        else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   710
                                self.toggle_counter -= 1
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   711
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   712
                        if self.toggle_counter > 0:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   713
                                self.w_um_install_button.set_sensitive(True)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   714
                        else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   715
                                self.toggle_counter = 0
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   716
                                self.w_um_install_button.set_sensitive(False)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   717
                                
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   718
        @staticmethod
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   719
        def __cell_data_function(column, renderer, model, itr, data):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   720
                '''Function which sets the background colour to black if package is 
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   721
                selected'''
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   722
                if itr:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   723
                        if model.get_value(itr, 1):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   724
                                #XXX Setting BOLD looks too noisy - disable for now
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   725
                                # renderer.set_property("weight", pango.WEIGHT_BOLD)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   726
                                renderer.set_property("weight", pango.WEIGHT_NORMAL)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   727
                        else:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   728
                                renderer.set_property("weight", pango.WEIGHT_NORMAL)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   729
        
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   730
        def __on_progressdialog_progress(self):
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   731
                if not self.progress_stop_thread:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   732
                        self.w_progressbar.pulse()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   733
                        return True
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   734
                else:
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   735
                        self.w_progress_dialog.hide()
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   736
                return False
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   737
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   738
        def setup_progressdialog_show(self, title):
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   739
                infobuffer = self.w_progressinfo_textview.get_buffer()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   740
                infobuffer.set_text("")
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   741
                self.w_progressinfo_label.hide()                        
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   742
                self.w_progressinfo_expander.hide()    
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   743
                self.w_progressinfo_separator.hide()                            
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   744
                self.w_progress_cancel.hide() 
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   745
                self.w_progress_ok.hide()
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   746
                self.w_progress_install_vbox.hide()   
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   747
                self.w_progress_closeon_finish_chk.hide()
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   748
                self.w_progress_ok.hide()                        
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   749
                self.w_progress_dialog.set_title(title)                
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   750
                self.w_progress_dialog.show()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   751
                self.progress_stop_thread = False
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   752
                gobject.timeout_add(100, self.__on_progressdialog_progress)
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   753
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   754
        def setup_updates(self):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   755
                Thread(target = self.get_updates_to_list(), args = ()).start()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   756
                return False
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   757
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   758
        @staticmethod
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   759
        def progress_pulse():
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   760
                if debug:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   761
                        print "pulse: \n"
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   762
                
997
4c5d85a87ea2 7791 Exception in updatemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 985
diff changeset
   763
        def update_package_list(self, update_list):
4c5d85a87ea2 7791 Exception in updatemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 985
diff changeset
   764
                self.pylintstub = update_list
4c5d85a87ea2 7791 Exception in updatemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 985
diff changeset
   765
                return
4c5d85a87ea2 7791 Exception in updatemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 985
diff changeset
   766
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   767
        def shutdown_after_image_update(self):
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   768
                self.__display_update_image_success()
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   769
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   770
#-------------------- remove those
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   771
def main():
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   772
        gtk.main()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   773
        return 0
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   774
        
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   775
if __name__ == "__main__":
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   776
        um = Updatemanager()
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   777
        list_uninstalled = False
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   778
        debug = False
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   779
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   780
        try:
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   781
                opts, args = getopt.getopt(sys.argv[1:], "huR:U:",
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   782
                    ["help", "uninstalled", "image-dir=", "update-all="])
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   783
        except getopt.error, msg:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   784
                print "%s, for help use --help" % msg
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   785
                sys.exit(2)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   786
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   787
        if os.path.isabs(sys.argv[0]):
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   788
                um.application_path = sys.argv[0]
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   789
        else:
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   790
                cmd = os.path.join(os.getcwd(), sys.argv[0])
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   791
                um.application_path = os.path.realpath(cmd)
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   792
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   793
        for option, argument in opts:
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   794
                if option in ("-h", "--help"):
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   795
                        print """\
1024
e83271f2e133 7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents: 1023
diff changeset
   796
Use -r (--refresh) to force a refresh before checking for updates.
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   797
Use -R (--image-dir) to specify image directory.
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   798
Use -U (--update-all) to proceed with Update All"""
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   799
                        sys.exit(0)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   800
                if option in ("-u", "--uninstalled"):
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   801
                        list_uninstalled = True
869
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   802
                if option in ("-R", "--image-dir"):
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   803
                        um.image_dir_arg = argument
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   804
                if option in ("-U", "--update-all"):
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   805
                        um.update_all_proceed = True
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   806
                        um.ua_be_name = argument
0197953cd88a 5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents: 860
diff changeset
   807
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   808
        um.init_tree_views()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   809
1209
640c256cb2a3 9596 PM / UM and webinstall should use common progress class
Michal Pryc <Michal.Pryc@Sun.Com>
parents: 1204
diff changeset
   810
        um.setup_progressdialog_show(_("Checking for new software"))
578
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   811
        gobject.timeout_add(UPDATES_FETCH_DELAY, um.setup_updates)
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   812
        main()
da257532b3f2 3816 RFE UpdateManager notify users of repo updates
John Rice <john.rice@sun.com>
parents:
diff changeset
   813