author | Padraig O'Briain <padraig.obriain@sun.com> |
Mon, 13 Jul 2009 13:50:23 +0100 | |
changeset 1217 | 1e2405e83d3a |
parent 1216 | ff1b8f7a5530 |
child 1218 | 49cd5492effc |
permissions | -rw-r--r-- |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.4 |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2 |
# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3 |
# CDDL HEADER START |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4 |
# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
5 |
# The contents of this file are subject to the terms of the |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
6 |
# Common Development and Distribution License (the "License"). |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
7 |
# You may not use this file except in compliance with the License. |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
8 |
# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
9 |
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
10 |
# or http://www.opensolaris.org/os/licensing. |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
11 |
# See the License for the specific language governing permissions |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
12 |
# and limitations under the License. |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
13 |
# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
14 |
# When distributing Covered Code, include this CDDL HEADER in each |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
15 |
# file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
16 |
# If applicable, add the following below this CDDL HEADER, with the |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
17 |
# fields enclosed by brackets "[]" replaced with your own identifying |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
18 |
# information: Portions Copyright [yyyy] [name of copyright owner] |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
19 |
# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
20 |
# CDDL HEADER END |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
21 |
# |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
22 |
# Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
23 |
# Use is subject to license terms. |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
24 |
# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
25 |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
26 |
# Progress: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
27 |
# Startup Progress has two phases: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
28 |
# - Start phase: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
29 |
# The start phase should be fairly constant at around a few seconds and so is given 5% |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
30 |
# of the total progress bar. |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
31 |
# - Package entry loading phase: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
32 |
# The package entry loading phase is given the remaining 95% of the bar for progress. |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
33 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
34 |
INITIAL_PROGRESS_TIME_INTERVAL = 0.5 # Time to update progress during start phase |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
35 |
INITIAL_PROGRESS_TIME_PERCENTAGE = 0.005 # Amount to update progress during start phase |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
36 |
INITIAL_PROGRESS_TOTAL_PERCENTAGE = 0.05 # Total progress for start phase |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
37 |
PACKAGE_PROGRESS_TOTAL_INCREMENTS = 95 # Total increments for loading phase |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
38 |
PACKAGE_PROGRESS_PERCENT_INCREMENT = 0.01 # Amount to update progress during loading phase |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
39 |
PACKAGE_PROGRESS_PERCENT_TOTAL = 1.0 # Total progress for loading phase |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
40 |
MAX_DESC_LEN = 60 # Max length of the description |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
41 |
MAX_INFO_CACHE_LIMIT = 100 # Max number of package descriptions to cache |
866 | 42 |
NOTEBOOK_PACKAGE_LIST_PAGE = 0 # Main Package List page index |
43 |
NOTEBOOK_START_PAGE = 1 # Main View Start page index |
|
1049
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
44 |
INFO_NOTEBOOK_LICENSE_PAGE = 3 # License Tab index |
1183
05f2a75fdcdf
9558 Support for typeahead search in Package Manager should be removed
John Rice <john.rice@sun.com>
parents:
1179
diff
changeset
|
45 |
SHOW_INFO_DELAY = 600 # Delay before showing selected pacakge information |
05f2a75fdcdf
9558 Support for typeahead search in Package Manager should be removed
John Rice <john.rice@sun.com>
parents:
1179
diff
changeset
|
46 |
SHOW_LICENSE_DELAY = 600 # Delay before showing license information |
1074
f6b6a4290aa2
8335 Search All Repositories should match CLI default search behavior
John Rice <john.rice@sun.com>
parents:
1071
diff
changeset
|
47 |
SEARCH_STR_FORMAT = "<%s>" |
985
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
48 |
MIN_APP_WIDTH = 750 # Minimum application width |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
49 |
MIN_APP_HEIGHT = 500 # Minimum application height |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
50 |
INITIAL_APP_WIDTH_PREFERENCES = "/apps/packagemanager/preferences/initial_app_width" |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
51 |
INITIAL_APP_HEIGHT_PREFERENCES = "/apps/packagemanager/preferences/initial_app_height" |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
52 |
INITIAL_APP_HPOS_PREFERENCES = "/apps/packagemanager/preferences/initial_app_hposition" |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
53 |
INITIAL_APP_VPOS_PREFERENCES = "/apps/packagemanager/preferences/initial_app_vposition" |
892 | 54 |
INITIAL_SHOW_FILTER_PREFERENCES = "/apps/packagemanager/preferences/initial_show_filter" |
55 |
INITIAL_SECTION_PREFERENCES = "/apps/packagemanager/preferences/initial_section" |
|
866 | 56 |
SHOW_STARTPAGE_PREFERENCES = "/apps/packagemanager/preferences/show_startpage" |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
57 |
API_SEARCH_ERROR_PREFERENCES = "/apps/packagemanager/preferences/api_search_error" |
866 | 58 |
CATEGORIES_STATUS_COLUMN_INDEX = 0 # Index of Status Column in Categories TreeView |
59 |
||
924
500d7c30cac7
7049 Accessible descriptions for images in "Status" column broken by rev 882
Padraig O'Briain <padraig.obriain@sun.com>
parents:
917
diff
changeset
|
60 |
STATUS_COLUMN_INDEX = 2 # Index of Status Column in Application TreeView |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
61 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
62 |
PKG_CLIENT_NAME = "packagemanager" |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
63 |
|
1164
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
64 |
# Location for themable icons |
1187
4ce20ffb5515
9680 PACKAGE_MANAGER_ROOT ignored for icon_theme search path
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1183
diff
changeset
|
65 |
ICON_LOCATION = "usr/share/package-manager/icons" |
866 | 66 |
# Load Start Page from lang dir if available |
955
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
67 |
START_PAGE_CACHE_LANG_BASE = "var/pkg/gui_cache/startpagebase/%s/%s" |
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
68 |
START_PAGE_LANG_BASE = "usr/share/package-manager/data/startpagebase/%s/%s" |
866 | 69 |
START_PAGE_HOME = "startpage.html" # Default page |
70 |
||
71 |
# StartPage Action support for url's on StartPage pages |
|
72 |
PM_ACTION = 'pm-action' # Action field for StartPage url's |
|
73 |
||
74 |
# Internal Example: <a href="pm?pm-action=internal&uri=top_picks.html"> |
|
75 |
ACTION_INTERNAL = 'internal' # Internal Action value: pm-action=internal |
|
76 |
INTERNAL_URI = 'uri' # Internal field: uri to navigate to in StartPage |
|
77 |
# without protocol scheme specified |
|
78 |
||
79 |
# External Example: <a href="pm?pm-action=external&uri=www.opensolaris.com"> |
|
80 |
ACTION_EXTERNAL = 'external' # External Action value: pm-action=external |
|
81 |
EXTERNAL_URI = 'uri' # External field: uri to navigate to in external |
|
82 |
# default browser without protocol scheme specified |
|
83 |
EXTERNAL_PROTOCOL = 'protocol' # External field: optional protocol scheme, |
|
84 |
# defaults to http |
|
85 |
DEFAULT_PROTOCOL = 'http' |
|
86 |
||
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
87 |
import getopt |
1028
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
88 |
import pwd |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
89 |
import os |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
90 |
import sys |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
91 |
import time |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
92 |
import locale |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
93 |
import itertools |
866 | 94 |
import urllib |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
95 |
import urlparse |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
96 |
import socket |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
97 |
import gettext |
830
687f8a73665e
6019 ctrl-c hangs packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
827
diff
changeset
|
98 |
import signal |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
99 |
from threading import Thread |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
100 |
from threading import Lock |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
101 |
from urllib2 import HTTPError, URLError |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
102 |
from cPickle import UnpicklingError |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
103 |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
104 |
try: |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
105 |
import gobject |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
106 |
import gnome |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
107 |
gobject.threads_init() |
821
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
108 |
import gconf |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
109 |
import gtk |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
110 |
import gtk.glade |
483 | 111 |
import pygtk |
112 |
pygtk.require("2.0") |
|
866 | 113 |
import gtkhtml2 |
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
114 |
import pango |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
115 |
from glib import GError |
483 | 116 |
except ImportError: |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
117 |
sys.exit(1) |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
118 |
import pkg.misc as misc |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
119 |
import pkg.client.progress as progress |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
120 |
import pkg.client.api_errors as api_errors |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
121 |
import pkg.client.api as api |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
122 |
import pkg.client.publisher as publisher |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
123 |
import pkg.portable as portable |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
124 |
import pkg.fmri as fmri |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
125 |
import pkg.gui.repository as repository |
543
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
126 |
import pkg.gui.beadmin as beadm |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
127 |
import pkg.gui.cache as cache |
869
0197953cd88a
5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents:
868
diff
changeset
|
128 |
import pkg.gui.misc as gui_misc |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
129 |
import pkg.gui.imageinfo as imageinfo |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
130 |
import pkg.gui.installupdate as installupdate |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
131 |
import pkg.gui.enumerations as enumerations |
866 | 132 |
import pkg.gui.parseqs as parseqs |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
133 |
import pkg.gui.webinstall as webinstall |
576
6ee6de304041
3777 PKG_TIMEOUT_MAX is a placebo setting
Dan Price <dp@eng.sun.com>
parents:
565
diff
changeset
|
134 |
from pkg.client import global_settings |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
135 |
|
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
136 |
# 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
|
137 |
import __builtin__ |
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
138 |
__builtin__._ = gettext.gettext |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
139 |
|
866 | 140 |
( |
141 |
DISPLAY_LINK, |
|
142 |
CLICK_LINK, |
|
143 |
) = range(2) |
|
144 |
||
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
145 |
class PackageManager: |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
146 |
def __init__(self): |
830
687f8a73665e
6019 ctrl-c hangs packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
827
diff
changeset
|
147 |
signal.signal(signal.SIGINT, self.__main_application_quit) |
1028
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
148 |
# We reset the HOME directory in case the user called us |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
149 |
# with gksu and had NFS mounted home directory in which |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
150 |
# case dbus called from gconf cannot write to the directory. |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
151 |
if os.getuid() == 0: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
152 |
home_dir = self.__find_root_home_dir() |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
153 |
os.putenv('HOME', home_dir) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
154 |
self.api_o = None |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
155 |
self.cache_o = None |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
156 |
self.img_timestamp = None |
821
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
157 |
self.client = gconf.client_get_default() |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
158 |
try: |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
159 |
self.initial_show_filter = \ |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
160 |
self.client.get_int(INITIAL_SHOW_FILTER_PREFERENCES) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
161 |
self.initial_section = \ |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
162 |
self.client.get_int(INITIAL_SECTION_PREFERENCES) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
163 |
self.show_startpage = \ |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
164 |
self.client.get_bool(SHOW_STARTPAGE_PREFERENCES) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
165 |
self.gconf_not_show_repos = \ |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
166 |
self.client.get_string(API_SEARCH_ERROR_PREFERENCES) |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
167 |
self.initial_app_width = \ |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
168 |
self.client.get_int(INITIAL_APP_WIDTH_PREFERENCES) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
169 |
self.initial_app_height = \ |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
170 |
self.client.get_int(INITIAL_APP_HEIGHT_PREFERENCES) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
171 |
self.initial_app_hpos = \ |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
172 |
self.client.get_int(INITIAL_APP_HPOS_PREFERENCES) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
173 |
self.initial_app_vpos = \ |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
174 |
self.client.get_int(INITIAL_APP_VPOS_PREFERENCES) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
175 |
except GError: |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
176 |
# Default values - the same as in the |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
177 |
# packagemanager-preferences.schemas |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
178 |
self.initial_show_filter = 0 |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
179 |
self.initial_section = 3 |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
180 |
self.show_startpage = True |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
181 |
self.gconf_not_show_repos = "" |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
182 |
self.initial_app_width = 800 |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
183 |
self.initial_app_height = 600 |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
184 |
self.initial_app_hpos = 200 |
1062
02749f19ab99
8218 Default position of bottom tabs in IPS makes the GUI look odd
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1059
diff
changeset
|
185 |
self.initial_app_vpos = 320 |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
186 |
|
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
187 |
if not self.gconf_not_show_repos: |
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
188 |
self.gconf_not_show_repos = "" |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
189 |
self.set_show_filter = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
190 |
self.set_section = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
191 |
self.current_search_option = 0 |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
192 |
self.in_search_mode = False |
985
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
193 |
|
1191
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
194 |
# Override default PKG_TIMEOUT_MAX and PKG_CLIENT_TIMEOUT |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
195 |
# if a value has been specified in the environment. |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
196 |
global_settings.PKG_TIMEOUT_MAX = int(os.environ.get( |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
197 |
"PKG_TIMEOUT_MAX", global_settings.PKG_TIMEOUT_MAX)) |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
198 |
|
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
199 |
global_settings.PKG_CLIENT_TIMEOUT = int(os.environ.get( |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
200 |
"PKG_CLIENT_TIMEOUT", global_settings.PKG_CLIENT_TIMEOUT)) |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
201 |
|
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
202 |
# This call only affects sockets created by Python. The |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
203 |
# transport framework must set the timeout value internally |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
204 |
# |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
205 |
# value is in seconds |
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
206 |
socket.setdefaulttimeout(global_settings.PKG_TIMEOUT_MAX) |
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
|
207 |
|
6bbfd2dece6f
4371 user-agent string needs to be different for different client front-ends
Danek Duvall <danek.duvall@sun.com>
parents:
660
diff
changeset
|
208 |
global_settings.client_name = PKG_CLIENT_NAME |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
209 |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
210 |
try: |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
211 |
self.application_dir = os.environ["PACKAGE_MANAGER_ROOT"] |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
212 |
except KeyError: |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
213 |
self.application_dir = "/" |
791
123e9401e939
5778 Inability to set locale leads to stack trace
Danek Duvall <danek.duvall@sun.com>
parents:
781
diff
changeset
|
214 |
misc.setlocale(locale.LC_ALL, "") |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
215 |
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:
1135
diff
changeset
|
216 |
module.bindtextdomain("pkg", os.path.join( |
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
217 |
self.application_dir, |
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
218 |
"usr/share/locale")) |
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
219 |
module.textdomain("pkg") |
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
220 |
# XXX Remove and use _() where self._ and self.parent._ are being used |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
221 |
self.main_window_title = _('Package Manager') |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
222 |
self.user_rights = portable.is_admin() |
483 | 223 |
self.cancelled = False # For background processes |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
224 |
self.image_directory = None |
483 | 225 |
self.description_thread_running = False # For background processes |
226 |
gtk.rc_parse('~/.gtkrc-1.2-gnome2') # Load gtk theme |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
227 |
self.progress_stop_timer_thread = False |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
228 |
self.progress_fraction_time_count = 0 |
483 | 229 |
self.progress_canceled = False |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
230 |
self.catalog_loaded = False |
483 | 231 |
self.image_dir_arg = None |
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
232 |
self.update_all_proceed = False |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
233 |
self.ua_be_name = None |
483 | 234 |
self.application_path = None |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
235 |
self.default_publisher = None |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
236 |
self.current_repos_with_search_errors = [] |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
237 |
self.first_run = True |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
238 |
self.in_reload = False |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
239 |
self.selected_pkgstem = None |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
240 |
self.selected_model = None |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
241 |
self.selected_path = None |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
242 |
self.info_cache = {} |
816
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
243 |
self.selected = 0 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
244 |
self.selected_pkgs = {} |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
245 |
self.start_page_url = None |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
246 |
self.to_install_update = {} |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
247 |
self.to_remove = {} |
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
248 |
self.in_startpage_startup = self.show_startpage |
866 | 249 |
self.lang = None |
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
250 |
self.lang_root = None |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
251 |
self.visible_status_id = 0 |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
252 |
self.categories_status_id = 0 |
1164
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
253 |
self.icon_theme = gtk.IconTheme() |
1187
4ce20ffb5515
9680 PACKAGE_MANAGER_ROOT ignored for icon_theme search path
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1183
diff
changeset
|
254 |
icon_location = os.path.join(self.application_dir, ICON_LOCATION) |
4ce20ffb5515
9680 PACKAGE_MANAGER_ROOT ignored for icon_theme search path
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1183
diff
changeset
|
255 |
self.icon_theme.append_search_path(icon_location) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
256 |
self.search_options = [ |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
257 |
('ips-search', |
1164
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
258 |
gui_misc.get_icon(self.icon_theme, 'search', 20), |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
259 |
_("_Current Repository"), |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
260 |
_("Search Current Repository")), |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
261 |
('ips-search-all', |
1164
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
262 |
gui_misc.get_icon(self.icon_theme, 'search_all', 20), |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
263 |
_("_All Repositories"), |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
264 |
_("Search All Repositories")) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
265 |
] |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
266 |
self.__register_iconsets(self.search_options) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
267 |
|
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
268 |
self.installed_icon = gui_misc.get_icon(self.icon_theme, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
269 |
'status_installed') |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
270 |
self.not_installed_icon = gui_misc.get_icon(self.icon_theme, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
271 |
'status_notinstalled') |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
272 |
self.update_available_icon = gui_misc.get_icon(self.icon_theme, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
273 |
'status_newupdate') |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
274 |
self.filter_options = [ |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
275 |
(enumerations.FILTER_ALL, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
276 |
gui_misc.get_icon(self.icon_theme, 'filter_all'), |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
277 |
_('All Packages')), |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
278 |
(enumerations.FILTER_INSTALLED, self.installed_icon, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
279 |
_('Installed Packages')), |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
280 |
(enumerations.FILTER_UPDATES, self.update_available_icon, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
281 |
_('Updates')), |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
282 |
(enumerations.FILTER_NOT_INSTALLED, self.not_installed_icon, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
283 |
_('Not installed Packages')), |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
284 |
(-1, None, ""), |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
285 |
(enumerations.FILTER_SELECTED, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
286 |
gui_misc.get_icon(self.icon_theme, 'filter_selected'), |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
287 |
_('Selected Packages')) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
288 |
] |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
289 |
self.last_visible_publisher = None |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
290 |
self.last_visible_publisher_uptodate = False |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
291 |
self.publisher_changed = True |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
292 |
self.search_start = 0 |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
293 |
self.search_time_sec = 0 |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
294 |
self.search_all_pub_being_searched = None |
892 | 295 |
self.section_list = None |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
296 |
self.filter_list = self.__get_new_filter_liststore() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
297 |
self.application_list = None |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
298 |
self.a11y_application_treeview = None |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
299 |
self.a11y_categories_treeview = None |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
300 |
self.application_treeview_range = None |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
301 |
self.application_treeview_initialized = False |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
302 |
self.categories_treeview_range = None |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
303 |
self.categories_treeview_initialized = False |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
304 |
self.category_list = None |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
305 |
self.repositories_list = None |
483 | 306 |
self.pr = progress.NullProgressTracker() |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
307 |
self.pylintstub = None |
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
308 |
self.release_notes_url = "http://www.opensolaris.org" |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
309 |
self.__image_activity_lock = Lock() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
310 |
|
483 | 311 |
# Create Widgets and show gui |
1137
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
312 |
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:
1135
diff
changeset
|
313 |
"usr/share/package-manager/packagemanager.glade") |
483 | 314 |
w_tree_main = gtk.glade.XML(self.gladefile, "mainwindow") |
315 |
w_tree_progress = gtk.glade.XML(self.gladefile, "progressdialog") |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
316 |
w_tree_preferences = gtk.glade.XML(self.gladefile, "preferencesdialog") |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
317 |
w_tree_api_search_error = gtk.glade.XML(self.gladefile, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
318 |
"api_search_error") |
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
319 |
self.w_preferencesdialog = \ |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
320 |
w_tree_preferences.get_widget("preferencesdialog") |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
321 |
self.w_startpage_checkbutton = \ |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
322 |
w_tree_preferences.get_widget("startpage_checkbutton") |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
323 |
self.api_search_error_dialog = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
324 |
w_tree_api_search_error.get_widget("api_search_error") |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
325 |
self.api_search_error_textview = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
326 |
w_tree_api_search_error.get_widget("api_search_error_text") |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
327 |
self.api_search_checkbox = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
328 |
w_tree_api_search_error.get_widget("api_search_checkbox") |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
329 |
self.api_search_button = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
330 |
w_tree_api_search_error.get_widget("api_search_button") |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
331 |
infobuffer = self.api_search_error_textview.get_buffer() |
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
332 |
infobuffer.create_tag("bold", weight=pango.WEIGHT_BOLD) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
333 |
|
483 | 334 |
self.w_main_window = w_tree_main.get_widget("mainwindow") |
985
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
335 |
self.w_main_hpaned = \ |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
336 |
w_tree_main.get_widget("main_hpaned") |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
337 |
self.w_main_vpaned = \ |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
338 |
w_tree_main.get_widget("main_vpaned") |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
339 |
|
483 | 340 |
self.w_application_treeview = \ |
341 |
w_tree_main.get_widget("applicationtreeview") |
|
342 |
self.w_categories_treeview = w_tree_main.get_widget("categoriestreeview") |
|
866 | 343 |
self.w_info_notebook = w_tree_main.get_widget("details_notebook") |
483 | 344 |
self.w_generalinfo_textview = \ |
345 |
w_tree_main.get_widget("generalinfotextview") |
|
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
346 |
self.w_generalinfo_textview.set_wrap_mode(gtk.WRAP_WORD) |
483 | 347 |
self.w_installedfiles_textview = \ |
348 |
w_tree_main.get_widget("installedfilestextview") |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
349 |
self.w_license_textview = \ |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
350 |
w_tree_main.get_widget("licensetextview") |
483 | 351 |
self.w_dependencies_textview = \ |
352 |
w_tree_main.get_widget("dependenciestextview") |
|
353 |
self.w_packagename_label = w_tree_main.get_widget("packagenamelabel") |
|
354 |
self.w_shortdescription_label = \ |
|
355 |
w_tree_main.get_widget("shortdescriptionlabel") |
|
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
356 |
w_package_hbox = \ |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
357 |
w_tree_main.get_widget("package_hbox") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
358 |
self.w_general_info_label = \ |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
359 |
w_tree_main.get_widget("general_info_label") |
866 | 360 |
self.w_startpage_frame = \ |
361 |
w_tree_main.get_widget("startpage_frame") |
|
362 |
self.w_startpage_eventbox = \ |
|
363 |
w_tree_main.get_widget("startpage_eventbox") |
|
364 |
self.w_startpage_eventbox.modify_bg(gtk.STATE_NORMAL, |
|
365 |
gtk.gdk.color_parse("white")) |
|
366 |
||
367 |
self.w_main_statusbar = w_tree_main.get_widget("statusbar") |
|
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
368 |
self.w_infosearch_frame = w_tree_main.get_widget("infosearch_frame") |
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
369 |
self.w_infosearch_button = w_tree_main.get_widget("infosearch_button") |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
370 |
|
866 | 371 |
self.w_main_view_notebook = \ |
372 |
w_tree_main.get_widget("main_view_notebook") |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
373 |
self.w_searchentry = w_tree_main.get_widget("searchentry") |
483 | 374 |
self.w_installupdate_button = \ |
375 |
w_tree_main.get_widget("install_update_button") |
|
376 |
self.w_remove_button = w_tree_main.get_widget("remove_button") |
|
377 |
self.w_updateall_button = w_tree_main.get_widget("update_all_button") |
|
378 |
self.w_reload_button = w_tree_main.get_widget("reloadbutton") |
|
379 |
self.w_repository_combobox = w_tree_main.get_widget("repositorycombobox") |
|
380 |
self.w_sections_combobox = w_tree_main.get_widget("sectionscombobox") |
|
381 |
self.w_filter_combobox = w_tree_main.get_widget("filtercombobox") |
|
382 |
self.w_packageicon_image = w_tree_main.get_widget("packageimage") |
|
383 |
self.w_installupdate_menuitem = \ |
|
384 |
w_tree_main.get_widget("package_install_update") |
|
385 |
self.w_remove_menuitem = w_tree_main.get_widget("package_remove") |
|
386 |
self.w_updateall_menuitem = w_tree_main.get_widget("package_update_all") |
|
387 |
self.w_cut_menuitem = w_tree_main.get_widget("edit_cut") |
|
388 |
self.w_copy_menuitem = w_tree_main.get_widget("edit_copy") |
|
389 |
self.w_paste_menuitem = w_tree_main.get_widget("edit_paste") |
|
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
390 |
self.w_delete_menuitem = w_tree_main.get_widget("edit_delete") |
483 | 391 |
self.w_selectall_menuitem = w_tree_main.get_widget("edit_select_all") |
392 |
self.w_selectupdates_menuitem = \ |
|
393 |
w_tree_main.get_widget("edit_select_updates") |
|
394 |
self.w_deselect_menuitem = w_tree_main.get_widget("edit_deselect") |
|
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
395 |
self.w_clear_search_menuitem = w_tree_main.get_widget("clear") |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
396 |
self.w_main_clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD) |
483 | 397 |
self.w_progress_dialog = w_tree_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:
1097
diff
changeset
|
398 |
self.w_progress_dialog.connect('delete-event', lambda stub1, stub2: True) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
399 |
self.w_progress_dialog.set_title(_("Update All")) |
483 | 400 |
self.w_progressinfo_label = w_tree_progress.get_widget("progressinfo") |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
401 |
self.w_progressinfo_label.set_text(_( |
483 | 402 |
"Checking SUNWipkg and SUNWipkg-gui versions\n\nPlease wait ...")) |
403 |
self.w_progressbar = w_tree_progress.get_widget("progressbar") |
|
404 |
self.w_progressbar.set_pulse_step(0.1) |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
405 |
self.w_progress_cancel = w_tree_progress.get_widget("progresscancel") |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
406 |
self.progress_canceled = False |
894
16698758b366
6974 Behavior of Clear Search (Brush Icon)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
893
diff
changeset
|
407 |
self.w_clear_search_button = w_tree_main.get_widget("clear_search") |
16698758b366
6974 Behavior of Clear Search (Brush Icon)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
893
diff
changeset
|
408 |
self.w_clear_search_button.set_sensitive(False) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
409 |
clear_search_image = w_tree_main.get_widget("clear_image") |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
410 |
clear_search_image.set_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_MENU) |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
411 |
self.saved_filter_combobox_active = self.initial_show_filter |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
412 |
self.search_image = w_tree_main.get_widget("search_image") |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
413 |
self.search_button = w_tree_main.get_widget("set_search") |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
414 |
self.a11y_search_button = self.search_button.get_accessible() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
415 |
self.is_search_all = False |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
416 |
self.searchmenu = gtk.Menu() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
417 |
self.search_image.set_from_pixbuf(self.search_options[0][1]) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
418 |
self.a11y_search_button.set_description(self.search_options[0][3]) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
419 |
for stock_id, pixbuf, label, description in self.search_options: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
420 |
action = gtk.Action(stock_id, label, None, stock_id) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
421 |
action.connect('activate', |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
422 |
self.__search_menu_item_activate) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
423 |
menu_item = action.create_menu_item() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
424 |
self.searchmenu.append(menu_item) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
425 |
self.pylintstub = description |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
426 |
self.pylintstub = pixbuf |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
427 |
self.changing_search_option = False |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
428 |
self.saved_repository_combobox_active = -1 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
429 |
self.saved_sections_combobox_active = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
430 |
self.saved_application_list = None |
1093
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
431 |
self.saved_application_list_filter = None |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
432 |
self.saved_application_list_sort = None |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
433 |
self.saved_category_list = None |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
434 |
self.saved_section_list = None |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
435 |
self.saved_selected_application_path = None |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
436 |
self.statusbar_message_id = 0 |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
437 |
toolbar = w_tree_main.get_widget("toolbutton2") |
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
438 |
toolbar.set_expand(True) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
439 |
self.__init_repository_tree_view() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
440 |
self.install_button_tooltip = gtk.Tooltips() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
441 |
self.remove_button_tooltip = gtk.Tooltips() |
483 | 442 |
self.__update_reload_button() |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
443 |
self.w_main_window.set_title(self.main_window_title) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
444 |
self.w_searchentry.grab_focus() |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
445 |
|
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
446 |
# Update All Completed Dialog |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
447 |
w_xmltree_ua_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:
1014
diff
changeset
|
448 |
"ua_completed_dialog") |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
449 |
self.w_ua_completed_dialog = w_xmltree_ua_completed.get_widget( |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
450 |
"ua_completed_dialog") |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
451 |
self.w_ua_completed_dialog .connect("destroy", |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
452 |
self.__on_ua_completed_close) |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
453 |
self.w_ua_completed_release_label = w_xmltree_ua_completed.get_widget( |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
454 |
"ua_completed_release_label") |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
455 |
self.w_ua_completed_linkbutton = w_xmltree_ua_completed.get_widget( |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
456 |
"ua_completed_linkbutton") |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
457 |
|
866 | 458 |
# Setup Start Page |
459 |
self.document = None |
|
460 |
self.view = None |
|
461 |
self.current_url = None |
|
462 |
self.opener = None |
|
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
463 |
self.__setup_startpage(self.show_startpage) |
866 | 464 |
|
483 | 465 |
try: |
466 |
dic_mainwindow = \ |
|
467 |
{ |
|
468 |
"on_mainwindow_delete_event": \ |
|
469 |
self.__on_mainwindow_delete_event, |
|
1216
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
470 |
"on_mainwindow_key_press_event": \ |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
471 |
self.__on_mainwindow_key_press_event, |
483 | 472 |
"on_searchentry_changed":self.__on_searchentry_changed, |
473 |
"on_searchentry_focus_in_event": \ |
|
474 |
self.__on_searchentry_focus_in, |
|
475 |
"on_searchentry_focus_out_event": \ |
|
476 |
self.__on_searchentry_focus_out, |
|
1135
ecf0a27789e3
8824 Package Manager search doesn't behave properly with IIIM
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1123
diff
changeset
|
477 |
"on_searchentry_activate": \ |
ecf0a27789e3
8824 Package Manager search doesn't behave properly with IIIM
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1123
diff
changeset
|
478 |
self.__on_searchentry_activate, |
483 | 479 |
"on_sectionscombobox_changed": \ |
480 |
self.__on_sectionscombobox_changed, |
|
481 |
"on_filtercombobox_changed": \ |
|
482 |
self.__on_filtercombobox_changed, |
|
483 |
"on_repositorycombobox_changed": \ |
|
484 |
self.__on_repositorycombobox_changed, |
|
485 |
#menu signals |
|
486 |
"on_file_quit_activate":self.__on_file_quit_activate, |
|
543
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
487 |
"on_file_be_activate":self.__on_file_be_activate, |
483 | 488 |
"on_package_install_update_activate": \ |
489 |
self.__on_install_update, |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
490 |
"on_settings_edit_repositories_activate": \ |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
491 |
self.__on_edit_repositories_activate, |
483 | 492 |
"on_package_remove_activate":self.__on_remove, |
493 |
"on_help_about_activate":self.__on_help_about, |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
494 |
"on_help_help_activate":self.__on_help_help, |
483 | 495 |
"on_edit_paste_activate":self.__on_edit_paste, |
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
496 |
"on_edit_delete_activate":self.__on_delete, |
483 | 497 |
"on_edit_copy_activate":self.__on_copy, |
498 |
"on_edit_cut_activate":self.__on_cut, |
|
1005
739eb81725b8
7824 Menus/shortcuts don't match HIG
John Rice <john.rice@sun.com>
parents:
996
diff
changeset
|
499 |
"on_edit_search_activate":self.__on_edit_search_clicked, |
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
500 |
"on_clear_search_activate":self.__on_clear_search, |
995
7ace85819158
7694 A mouse-click is necessary to change search options in packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
985
diff
changeset
|
501 |
"on_set_search_clicked":self.__on_set_search_clicked, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
502 |
"on_set_search_button_press_event":self.__on_set_search, |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
503 |
"on_clear_search_clicked":self.__on_clear_search, |
483 | 504 |
"on_edit_select_all_activate":self.__on_select_all, |
505 |
"on_edit_select_updates_activate": \ |
|
506 |
self.__on_select_updates, |
|
507 |
"on_edit_deselect_activate":self.__on_deselect, |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
508 |
"on_edit_preferences_activate":self.__on_preferences, |
483 | 509 |
# XXX disabled until new API |
510 |
"on_package_update_all_activate":self.__on_update_all, |
|
511 |
#toolbar signals |
|
512 |
# XXX disabled until new API |
|
513 |
"on_update_all_button_clicked":self.__on_update_all, |
|
514 |
"on_reload_button_clicked":self.__on_reload, |
|
515 |
"on_install_update_button_clicked": \ |
|
516 |
self.__on_install_update, |
|
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
517 |
"on_remove_button_clicked":self.__on_remove, |
866 | 518 |
"on_help_start_page_activate":self.__on_startpage, |
519 |
"on_details_notebook_switch_page": \ |
|
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
520 |
self.__on_notebook_change, |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
521 |
"on_infosearch_button_clicked": \ |
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
522 |
self.__on_infosearch_button_clicked, |
483 | 523 |
} |
524 |
dic_progress = \ |
|
525 |
{ |
|
526 |
"on_cancel_progressdialog_clicked": \ |
|
527 |
self.__on_cancel_progressdialog_clicked, |
|
528 |
} |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
529 |
dic_preferences = \ |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
530 |
{ |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
531 |
"on_startpage_checkbutton_toggled": \ |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
532 |
self.__on_startpage_checkbutton_toggled, |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
533 |
"on_preferenceshelp_clicked": \ |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
534 |
self.__on_preferenceshelp_clicked, |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
535 |
"on_preferencesclose_clicked": \ |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
536 |
self.__on_preferencesclose_clicked, |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
537 |
} |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
538 |
dic_api_search_error = \ |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
539 |
{ |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
540 |
"on_api_search_checkbox_toggled": \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
541 |
self.__on_api_search_checkbox_toggled, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
542 |
"on_api_search_button_clicked": \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
543 |
self.__on_api_search_button_clicked, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
544 |
"on_api_search_error_delete_event": \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
545 |
self.__on_api_search_error_delete_event, |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
546 |
} |
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
547 |
dic_completed = \ |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
548 |
{ |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
549 |
"on_ua_complete_close_button_clicked": \ |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
550 |
self.__on_ua_completed_close, |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
551 |
"on_ua_completed_linkbutton_clicked": \ |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
552 |
self.__on_ua_completed_linkbutton_clicked, |
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
553 |
} |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
554 |
w_xmltree_ua_completed.signal_autoconnect(dic_completed) |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
555 |
|
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
556 |
|
483 | 557 |
w_tree_main.signal_autoconnect(dic_mainwindow) |
558 |
w_tree_progress.signal_autoconnect(dic_progress) |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
559 |
w_tree_preferences.signal_autoconnect(dic_preferences) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
560 |
w_tree_api_search_error.signal_autoconnect( |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
561 |
dic_api_search_error) |
483 | 562 |
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
|
563 |
print _( |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
564 |
"GUI will not respond to any event! %s." |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
565 |
"Check declare_signals()") \ |
483 | 566 |
% error |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
567 |
|
483 | 568 |
self.package_selection = None |
569 |
self.category_list_filter = None |
|
697 | 570 |
self.application_list_filter = None |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
571 |
self.application_list_sort = None |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
572 |
self.application_refilter_id = 0 |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
573 |
self.application_refilter_idle_id = 0 |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
574 |
self.last_show_info_id = 0 |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
575 |
self.show_info_id = 0 |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
576 |
self.last_show_licenses_id = 0 |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
577 |
self.show_licenses_id = 0 |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
578 |
self.showing_empty_details = False |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
579 |
self.in_setup = True |
985
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
580 |
if self.initial_app_width >= MIN_APP_WIDTH and \ |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
581 |
self.initial_app_height >= MIN_APP_HEIGHT: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
582 |
self.w_main_window.resize(self.initial_app_width, |
985
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
583 |
self.initial_app_height) |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
584 |
if self.initial_app_hpos > 0: |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
585 |
self.w_main_hpaned.set_position(self.initial_app_hpos) |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
586 |
if self.initial_app_vpos > 0: |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
587 |
self.w_main_vpaned.set_position(self.initial_app_vpos) |
483 | 588 |
self.w_main_window.show_all() |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
589 |
gdk_win = self.w_main_window.get_window() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
590 |
self.gdk_window = gtk.gdk.Window(gdk_win, gtk.gdk.screen_width(), |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
591 |
gtk.gdk.screen_height(), gtk.gdk.WINDOW_CHILD, 0, gtk.gdk.INPUT_ONLY) |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
592 |
gdk_cursor = gtk.gdk.Cursor(gtk.gdk.WATCH) |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
593 |
self.gdk_window.set_cursor(gdk_cursor) |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
594 |
# Until package icons become available hide Package Icon Panel |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
595 |
w_package_hbox.hide() |
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
596 |
if self.show_startpage: |
866 | 597 |
self.w_main_view_notebook.set_current_page(NOTEBOOK_START_PAGE) |
598 |
else: |
|
599 |
self.w_main_view_notebook.set_current_page( |
|
600 |
NOTEBOOK_PACKAGE_LIST_PAGE) |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
601 |
self.api_search_error_dialog.set_transient_for(self.w_main_window) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
602 |
self.__setup_text_signals() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
603 |
|
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
604 |
def __setup_text_signals(self): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
605 |
self.w_generalinfo_textview.get_buffer().connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
606 |
"notify::has-selection", self.__on_text_buffer_has_selection) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
607 |
self.w_installedfiles_textview.get_buffer().connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
608 |
"notify::has-selection", self.__on_text_buffer_has_selection) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
609 |
self.w_dependencies_textview.get_buffer().connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
610 |
"notify::has-selection", self.__on_text_buffer_has_selection) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
611 |
self.w_license_textview.get_buffer().connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
612 |
"notify::has-selection", self.__on_text_buffer_has_selection) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
613 |
self.w_searchentry.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
614 |
"notify::cursor-position", self.__on_searchentry_selection) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
615 |
self.w_searchentry.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
616 |
"notify::selection-bound", self.__on_searchentry_selection) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
617 |
self.w_generalinfo_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
618 |
"focus-in-event", self.__on_textview_focus_in) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
619 |
self.w_installedfiles_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
620 |
"focus-in-event", self.__on_textview_focus_in) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
621 |
self.w_dependencies_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
622 |
"focus-in-event", self.__on_textview_focus_in) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
623 |
self.w_license_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
624 |
"focus-in-event", self.__on_textview_focus_in) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
625 |
self.w_generalinfo_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
626 |
"focus-out-event", self.__on_textview_focus_out) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
627 |
self.w_installedfiles_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
628 |
"focus-out-event", self.__on_textview_focus_out) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
629 |
self.w_dependencies_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
630 |
"focus-out-event", self.__on_textview_focus_out) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
631 |
self.w_license_textview.connect( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
632 |
"focus-out-event", self.__on_textview_focus_out) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
633 |
|
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
634 |
def __on_textview_focus_in(self, widget, event): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
635 |
char_count = widget.get_buffer().get_char_count() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
636 |
if char_count > 0: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
637 |
self.w_selectall_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
638 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
639 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
640 |
bounds = widget.get_buffer().get_selection_bounds() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
641 |
if bounds: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
642 |
offset1 = bounds[0].get_offset() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
643 |
offset2 = bounds[1].get_offset() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
644 |
if abs(offset2 - offset1) == char_count: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
645 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
646 |
self.w_deselect_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
647 |
self.w_copy_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
648 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
649 |
self.w_deselect_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
650 |
|
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
651 |
def __on_textview_focus_out(self, widget, event): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
652 |
self.__enable_disable_select_all() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
653 |
self.__enable_disable_deselect() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
654 |
self.w_copy_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
655 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
656 |
def __on_text_buffer_has_selection(self, obj, pspec): |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
657 |
if obj.get_selection_bounds(): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
658 |
self.w_copy_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
659 |
self.w_deselect_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
660 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
661 |
self.w_copy_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
662 |
self.w_deselect_menuitem.set_sensitive(False) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
663 |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
664 |
def __register_iconsets(self, icon_info): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
665 |
factory = gtk.IconFactory() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
666 |
for stock_id, pixbuf, name, description in icon_info: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
667 |
iconset = gtk.IconSet(pixbuf) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
668 |
factory.add(stock_id, iconset) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
669 |
self.pylintstub = name |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
670 |
self.pylintstub = description |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
671 |
factory.add_default() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
672 |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
673 |
def __set_search_option(self, i): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
674 |
# The value i is the index in the table search_options |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
675 |
# of the current choice. |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
676 |
# Index 0 corresponds to Current Repository. |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
677 |
# We assume that anything else is search all. |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
678 |
# This may need to be revisited if more search options are |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
679 |
# added. |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
680 |
if i == self.current_search_option: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
681 |
return |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
682 |
self.current_search_option = i |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
683 |
self.changing_search_option = True |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
684 |
is_search_all = (i != 0) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
685 |
self.__update_repository_combobox_for_search(is_search_all) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
686 |
if is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
687 |
self.__setup_before_search_all_mode() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
688 |
else: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
689 |
self.__restore_setup_for_browse() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
690 |
self.changing_search_option = False |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
691 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
692 |
def __update_repository_combobox_for_search(self, is_search_all): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
693 |
if is_search_all: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
694 |
self.saved_repository_combobox_active = \ |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
695 |
self.w_repository_combobox.get_active() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
696 |
self.__disconnect_repository_model() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
697 |
if is_search_all: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
698 |
self.repositories_list.prepend( |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
699 |
[-1, _("All Repositories Search Results"), ]) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
700 |
else: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
701 |
self.repositories_list.remove( |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
702 |
self.repositories_list.get_iter_first()) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
703 |
self.w_repository_combobox.set_model(self.repositories_list) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
704 |
|
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
705 |
def __search_menu_item_activate(self, widget): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
706 |
name = widget.get_name() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
707 |
i = 0 |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
708 |
for stock_id, pixbuf, label, description in self.search_options: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
709 |
if stock_id == name: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
710 |
self.__set_search_option(i) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
711 |
self.search_image.set_from_pixbuf(pixbuf) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
712 |
self.a11y_search_button.set_description(description) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
713 |
break |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
714 |
i += 1 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
715 |
self.pylintstub = label |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
716 |
|
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
717 |
def __setup_startpage(self, show_startpage): |
866 | 718 |
self.opener = urllib.FancyURLopener() |
719 |
self.document = gtkhtml2.Document() |
|
720 |
self.document.connect('request_url', self.__request_url) |
|
721 |
self.document.connect('link_clicked', self.__handle_link) |
|
722 |
self.document.clear() |
|
723 |
||
724 |
self.view = gtkhtml2.View() |
|
725 |
self.view.set_document(self.document) |
|
726 |
self.view.connect('request_object', self.__request_object) |
|
727 |
self.view.connect('on_url', self.__on_url) |
|
728 |
||
729 |
try: |
|
730 |
self.lang, encode = locale.getlocale(locale.LC_CTYPE) |
|
731 |
if debug: |
|
732 |
print "Lang: %s: Encode: %s" % (self.lang, encode) |
|
733 |
except locale.Error: |
|
734 |
self.lang = "C" |
|
735 |
if self.lang == None or self.lang == "": |
|
736 |
self.lang = "C" |
|
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
737 |
self.lang_root = self.lang.split('_')[0] |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
738 |
if show_startpage: |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
739 |
self.__load_startpage() |
866 | 740 |
self.w_startpage_frame.add(self.view) |
741 |
||
742 |
# Stub handler required by GtkHtml widget |
|
743 |
def __request_object(self, *vargs): |
|
744 |
pass |
|
745 |
||
746 |
def __load_startpage(self): |
|
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
747 |
if self.__load_startpage_locale(START_PAGE_CACHE_LANG_BASE): |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
748 |
return |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
749 |
if self.__load_startpage_locale(START_PAGE_LANG_BASE): |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
750 |
return |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
751 |
self.__handle_startpage_load_error(self.start_page_url) |
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
752 |
|
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
753 |
|
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
754 |
def __load_startpage_locale(self, start_page_lang_base): |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
755 |
self.start_page_url = os.path.join(self.application_dir, |
1137
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
756 |
start_page_lang_base % (self.lang, START_PAGE_HOME)) |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
757 |
if self.__load_uri(self.document, self.start_page_url): |
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
758 |
return True |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
759 |
|
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
760 |
if self.lang_root != None and self.lang_root != self.lang: |
1137
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
761 |
start_page_url = os.path.join(self.application_dir, |
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
762 |
start_page_lang_base % (self.lang_root, START_PAGE_HOME)) |
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
763 |
if self.__load_uri(self.document, start_page_url): |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
764 |
return True |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
765 |
|
1137
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
766 |
start_page_url = os.path.join(self.application_dir, |
f6c7c39981aa
8660 packagemanager traceback if PACKAGE_MANAGER_ROOT missing trailing '/'
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1135
diff
changeset
|
767 |
start_page_lang_base % ("C", START_PAGE_HOME)) |
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
768 |
if self.__load_uri(self.document, start_page_url): |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
769 |
return True |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
770 |
return False |
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
771 |
|
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
772 |
def __handle_startpage_load_error(self, start_page_url): |
955
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
773 |
self.document.open_stream('text/html') |
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
774 |
self.document.write_stream(_( |
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
775 |
"<html><head></head><body><H2>Welcome to" |
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
776 |
"PackageManager!</H2><br>" |
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
777 |
"<font color='#0000FF'>Warning: Unable to " |
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
778 |
"load Start Page:<br>%s</font></body></html>" |
1095
67b0d3b9c7e1
8526 PM locale start_page detection needs enhanced
John Rice <john.rice@sun.com>
parents:
1093
diff
changeset
|
779 |
% (start_page_url))) |
955
65a22a086fc9
6970 Start page needs to be updateable
John Rice <john.rice@sun.com>
parents:
947
diff
changeset
|
780 |
self.document.close_stream() |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
781 |
|
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
782 |
def __process_api_search_error(self, error): |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
783 |
self.current_repos_with_search_errors = [] |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
784 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
785 |
for pub, err in error.failed_servers: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
786 |
self.current_repos_with_search_errors.append( |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
787 |
(pub, _("failed to respond"), err)) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
788 |
for pub in error.invalid_servers: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
789 |
self.current_repos_with_search_errors.append( |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
790 |
(pub, _("invalid response"), |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
791 |
_("A valid response was not returned."))) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
792 |
for pub, err in error.unsupported_servers: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
793 |
self.current_repos_with_search_errors.append( |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
794 |
(pub, _("unsupported search"), err)) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
795 |
|
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
796 |
def __on_infosearch_button_clicked(self, widget): |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
797 |
self.__handle_api_search_error(True) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
798 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
799 |
def __handle_api_search_error(self, show_all=False): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
800 |
if len(self.current_repos_with_search_errors) == 0: |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
801 |
self.w_infosearch_frame.hide() |
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
802 |
return |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
803 |
|
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
804 |
repo_count = 0 |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
805 |
for pub, err_type, err_str in self.current_repos_with_search_errors: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
806 |
if show_all or (pub not in self.gconf_not_show_repos): |
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
807 |
repo_count += 1 |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
808 |
if repo_count == 0: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
809 |
self.w_infosearch_frame.hide() |
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
810 |
return |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
811 |
|
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
812 |
self.w_infosearch_button.set_size_request(26, 22) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
813 |
self.w_infosearch_frame.show() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
814 |
infobuffer = self.api_search_error_textview.get_buffer() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
815 |
infobuffer.set_text("") |
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
816 |
textiter = infobuffer.get_end_iter() |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
817 |
for pub, err_type, err_str in self.current_repos_with_search_errors: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
818 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
819 |
if show_all or (pub not in self.gconf_not_show_repos): |
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
820 |
infobuffer.insert_with_tags_by_name(textiter, |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
821 |
"%(pub)s (%(err_type)s)\n" % {"pub": pub, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
822 |
"err_type": err_type}, "bold") |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
823 |
infobuffer.insert(textiter, "%s\n" % (err_str)) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
824 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
825 |
self.api_search_checkbox.set_active(False) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
826 |
self.api_search_error_dialog.show() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
827 |
self.api_search_button.grab_focus() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
828 |
|
968
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
829 |
def __get_repo_publishers(self): |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
830 |
repo_pub_dict = {} |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
831 |
pubs = self.api_o.get_publishers() |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
832 |
for pub in pubs: |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
833 |
repo = pub.selected_repository |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
834 |
origin = repo.origins[0] |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
835 |
repo_pub_dict[origin.uri] = pub.prefix |
77305ca94261
7563 Remote search error rework (follow on)
John Rice <john.rice@sun.com>
parents:
963
diff
changeset
|
836 |
return repo_pub_dict |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
837 |
|
866 | 838 |
def __on_url(self, view, link): |
839 |
# Handle mouse over events on links and reset when not on link |
|
840 |
if link == None or link == "": |
|
841 |
self.update_statusbar() |
|
842 |
else: |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
843 |
display_link = self.__handle_link(None, link, DISPLAY_LINK) |
866 | 844 |
if display_link != None: |
845 |
self.w_main_statusbar.push(0, display_link) |
|
846 |
else: |
|
847 |
self.update_statusbar() |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
848 |
|
866 | 849 |
@staticmethod |
850 |
def __is_relative_to_server(url): |
|
851 |
parts = urlparse.urlparse(url) |
|
852 |
if parts[0] or parts[1]: |
|
853 |
return 0 |
|
854 |
return 1 |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
855 |
|
866 | 856 |
def __open_url(self, url): |
857 |
uri = self.__resolve_uri(url) |
|
858 |
return self.opener.open(uri) |
|
859 |
||
860 |
def __resolve_uri(self, uri): |
|
861 |
if self.__is_relative_to_server(uri) and self.current_url != uri: |
|
862 |
return urlparse.urljoin(self.current_url, uri) |
|
863 |
return uri |
|
864 |
||
865 |
def __request_url(self, document, url, stream): |
|
866 |
f = self.__open_url(url) |
|
867 |
stream.set_cancel_func(self.__stream_cancel) |
|
868 |
stream.write(f.read()) |
|
869 |
||
870 |
# Stub handler required by GtkHtml widget or widget will assert |
|
871 |
def __stream_cancel(self, *vargs): |
|
872 |
pass |
|
873 |
||
874 |
def __load_uri(self, document, link): |
|
875 |
self.w_main_statusbar.push(0, _("Loading... " + link)) |
|
876 |
try: |
|
877 |
f = self.__open_url(link) |
|
878 |
except (IOError, OSError), err: |
|
879 |
if debug: |
|
880 |
print "err: %s" % (err) |
|
881 |
self.w_main_statusbar.push(0, _("Stopped")) |
|
882 |
return False |
|
883 |
self.current_url = self.__resolve_uri(link) |
|
884 |
||
885 |
self.document.clear() |
|
886 |
headers = f.info() |
|
887 |
mime = headers.getheader('Content-type').split(';')[0] |
|
888 |
if mime: |
|
889 |
self.document.open_stream(mime) |
|
890 |
else: |
|
891 |
self.document.open_stream('text/plain') |
|
892 |
||
893 |
self.document.write_stream(f.read()) |
|
894 |
self.document.close_stream() |
|
895 |
self.w_main_statusbar.push(0, _("Done")) |
|
896 |
return True |
|
897 |
||
898 |
def __link_load_error(self, link): |
|
899 |
self.document.clear() |
|
900 |
self.document.open_stream('text/html') |
|
901 |
self.document.write_stream(_( |
|
902 |
"<html><head></head><body><font color='#000000'>\ |
|
903 |
<a href='stub'></a></font>\ |
|
904 |
<a href='pm?%s=internal&uri=%s'>\ |
|
905 |
<IMG SRC = 'startpage_star.png' \ |
|
906 |
style='border-style: none'></a> <br><br>\ |
|
907 |
<h2><font color='#0000FF'>Warning: Unable to \ |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
908 |
load URL</font></h2><br>%s</body></html>" |
866 | 909 |
% (PM_ACTION, START_PAGE_HOME, link))) |
910 |
self.document.close_stream() |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
911 |
|
866 | 912 |
def __handle_link(self, document, link, handle_what = CLICK_LINK): |
913 |
query_dict = self.__urlparse_qs(link) |
|
914 |
||
915 |
action = None |
|
916 |
if query_dict.has_key(PM_ACTION): |
|
917 |
action = query_dict[PM_ACTION][0] |
|
918 |
elif handle_what == DISPLAY_LINK: |
|
919 |
return link |
|
920 |
ext_uri = "" |
|
921 |
protocol = None |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
922 |
|
866 | 923 |
# Internal Browse |
924 |
if action == ACTION_INTERNAL: |
|
925 |
if query_dict.has_key(INTERNAL_URI): |
|
926 |
int_uri = query_dict[INTERNAL_URI][0] |
|
927 |
if handle_what == DISPLAY_LINK: |
|
928 |
return int_uri |
|
929 |
else: |
|
930 |
if handle_what == CLICK_LINK: |
|
931 |
self.__link_load_error(_("No URI specified")) |
|
932 |
return |
|
933 |
if handle_what == CLICK_LINK and \ |
|
934 |
not self.__load_uri(document, int_uri): |
|
935 |
self.__link_load_error(int_uri) |
|
936 |
return |
|
937 |
# External browse |
|
938 |
elif action == ACTION_EXTERNAL: |
|
939 |
if query_dict.has_key(EXTERNAL_URI): |
|
940 |
ext_uri = query_dict[EXTERNAL_URI][0] |
|
941 |
else: |
|
942 |
if handle_what == CLICK_LINK: |
|
943 |
self.__link_load_error(_("No URI specified")) |
|
944 |
return |
|
945 |
if query_dict.has_key(EXTERNAL_PROTOCOL): |
|
946 |
protocol = query_dict[EXTERNAL_PROTOCOL][0] |
|
947 |
else: |
|
948 |
protocol = DEFAULT_PROTOCOL |
|
949 |
||
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
950 |
if handle_what == DISPLAY_LINK: |
866 | 951 |
return protocol + "://" + ext_uri |
952 |
try: |
|
953 |
gnome.url_show(protocol + "://" + ext_uri) |
|
954 |
except gobject.GError: |
|
955 |
self.__link_load_error(protocol + "://" + ext_uri) |
|
956 |
elif handle_what == DISPLAY_LINK: |
|
957 |
return None |
|
958 |
elif action == None: |
|
959 |
try: |
|
960 |
gnome.url_show(link) |
|
961 |
except gobject.GError: |
|
962 |
self.__link_load_error(link) |
|
963 |
# Handle empty and unsupported actions |
|
964 |
elif action == "": |
|
965 |
self.__link_load_error(_("Empty Action not supported" |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
966 |
% action)) |
866 | 967 |
return |
968 |
elif action != None: |
|
969 |
self.__link_load_error(_("Action not supported: %s" |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
970 |
% action)) |
866 | 971 |
return |
972 |
||
973 |
@staticmethod |
|
974 |
def __urlparse_qs(url, keep_blank_values=0, strict_parsing=0): |
|
975 |
scheme, netloc, url, params, querystring, fragment = urlparse.urlparse( |
|
976 |
url) |
|
977 |
if debug: |
|
978 |
print ("Query: scheme %s, netloc %s, url %s, params %s," |
|
979 |
"querystring %s, fragment %s" |
|
980 |
% (scheme, netloc, url, params, querystring, fragment)) |
|
981 |
return parseqs.parse_qs(querystring) |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
982 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
983 |
@staticmethod |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
984 |
def __get_new_application_liststore(): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
985 |
return gtk.ListStore( |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
986 |
gobject.TYPE_BOOLEAN, # enumerations.MARK_COLUMN |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
987 |
gtk.gdk.Pixbuf, # enumerations.STATUS_ICON_COLUMN |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
988 |
gobject.TYPE_STRING, # enumerations.NAME_COLUMN |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
989 |
gobject.TYPE_STRING, # enumerations.DESCRIPTION_COLUMN |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
990 |
gobject.TYPE_INT, # enumerations.STATUS_COLUMN |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
991 |
gobject.TYPE_PYOBJECT, # enumerations.FMRI_COLUMN |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
992 |
gobject.TYPE_STRING, # enumerations.STEM_COLUMN |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
993 |
gobject.TYPE_STRING, # enumerations.DISPLAY_NAME_COLUMN |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
994 |
gobject.TYPE_BOOLEAN, # enumerations.IS_VISIBLE_COLUMN |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
995 |
gobject.TYPE_PYOBJECT, # enumerations.CATEGORY_LIST_COLUMN |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
996 |
gobject.TYPE_STRING # enumerations.REPOSITORY_COLUMN |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
997 |
) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
998 |
|
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
999 |
@staticmethod |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1000 |
def __get_new_category_liststore(): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1001 |
return gtk.ListStore( |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1002 |
gobject.TYPE_INT, # enumerations.CATEGORY_ID |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1003 |
gobject.TYPE_STRING, # enumerations.CATEGORY_NAME |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1004 |
gobject.TYPE_STRING, # enumerations.CATEGORY_DESCRIPTION |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1005 |
gtk.gdk.Pixbuf, # enumerations.CATEGORY_ICON |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1006 |
gobject.TYPE_BOOLEAN, # enumerations.CATEGORY_ICON_VISIBLE |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1007 |
gobject.TYPE_BOOLEAN, # enumerations.CATEGORY_VISIBLE |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1008 |
gobject.TYPE_PYOBJECT, # enumerations.SECTION_LIST_OBJECT |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1009 |
) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1010 |
|
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1011 |
@staticmethod |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1012 |
def __get_new_section_liststore(): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1013 |
return gtk.ListStore( |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1014 |
gobject.TYPE_INT, # enumerations.SECTION_ID |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1015 |
gobject.TYPE_STRING, # enumerations.SECTION_NAME |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1016 |
gobject.TYPE_STRING, # enumerations.SECTION_SUBCATEGORY |
892 | 1017 |
gobject.TYPE_BOOLEAN, # enumerations.SECTION_ENABLED |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1018 |
) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1019 |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1020 |
@staticmethod |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1021 |
def __get_new_filter_liststore(): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1022 |
return gtk.ListStore( |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1023 |
gobject.TYPE_INT, # enumerations.FILTER_ID |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1024 |
gtk.gdk.Pixbuf, # enumerations.FILTER_ICON |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1025 |
gobject.TYPE_STRING, # enumerations.FILTER_NAME |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1026 |
) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1027 |
|
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1028 |
@staticmethod |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1029 |
def __get_new_repositories_liststore(): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1030 |
return gtk.ListStore( |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1031 |
gobject.TYPE_INT, # enumerations.REPOSITORY_ID |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1032 |
gobject.TYPE_STRING, # enumerations.REPOSITORY_NAME |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1033 |
) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1034 |
|
1093
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1035 |
def __init_application_tree_view(self, application_list, |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1036 |
application_list_filter, application_list_sort, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1037 |
application_sort_column): |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1038 |
##APPLICATION MAIN TREEVIEW |
1093
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1039 |
if application_list_filter == None: |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1040 |
application_list_filter = application_list.filter_new() |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1041 |
if application_list_sort == None: |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1042 |
application_list_sort = \ |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1043 |
gtk.TreeModelSort(application_list_filter) |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1044 |
application_list_sort.set_sort_column_id( |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1045 |
application_sort_column, gtk.SORT_ASCENDING) |
1093
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1046 |
application_list_sort.set_sort_func( |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1047 |
enumerations.STATUS_ICON_COLUMN, self.__status_sort_func) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1048 |
toggle_renderer = gtk.CellRendererToggle() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1049 |
|
483 | 1050 |
column = gtk.TreeViewColumn("", toggle_renderer, \ |
1051 |
active = enumerations.MARK_COLUMN) |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1052 |
column.set_sort_column_id(enumerations.MARK_COLUMN) |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1053 |
column.set_sort_indicator(True) |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1054 |
column.set_cell_data_func(toggle_renderer, self.cell_data_function, None) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1055 |
column.connect_after('clicked', |
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1056 |
self.__application_treeview_column_sorted, None) |
483 | 1057 |
self.w_application_treeview.append_column(column) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1058 |
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
|
1059 |
column = gtk.TreeViewColumn(_("Name"), name_renderer, |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1060 |
text = enumerations.NAME_COLUMN) |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
1061 |
column.set_resizable(True) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1062 |
column.set_min_width(150) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1063 |
column.set_sort_column_id(enumerations.NAME_COLUMN) |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1064 |
column.set_sort_indicator(True) |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1065 |
column.set_cell_data_func(name_renderer, self.cell_data_function, None) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1066 |
column.connect_after('clicked', |
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1067 |
self.__application_treeview_column_sorted, None) |
483 | 1068 |
self.w_application_treeview.append_column(column) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1069 |
column = self.__create_icon_column(_("Status"), True, |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1070 |
enumerations.STATUS_ICON_COLUMN, True) |
863
6ddc7b63fce3
6346 Sorting packages by status is broken effective build 106
Padraig O'Briain <padraig.obriain@sun.com>
parents:
861
diff
changeset
|
1071 |
column.set_sort_column_id(enumerations.STATUS_ICON_COLUMN) |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
1072 |
column.set_sort_indicator(True) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1073 |
column.connect_after('clicked', |
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1074 |
self.__application_treeview_column_sorted, None) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1075 |
self.w_application_treeview.append_column(column) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1076 |
if self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1077 |
repository_renderer = gtk.CellRendererText() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1078 |
column = gtk.TreeViewColumn(_('Repository'), |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1079 |
repository_renderer, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1080 |
text = enumerations.AUTHORITY_COLUMN) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1081 |
column.set_sort_column_id(enumerations.AUTHORITY_COLUMN) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1082 |
column.set_resizable(True) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1083 |
column.set_sort_indicator(True) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1084 |
column.set_cell_data_func(repository_renderer, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1085 |
self.cell_data_function, None) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1086 |
column.connect_after('clicked', |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1087 |
self.__application_treeview_column_sorted, None) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1088 |
self.w_application_treeview.append_column(column) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1089 |
description_renderer = gtk.CellRendererText() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1090 |
column = gtk.TreeViewColumn(_('Description'), |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1091 |
description_renderer, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1092 |
text = enumerations.DESCRIPTION_COLUMN) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1093 |
column.set_sort_column_id(enumerations.DESCRIPTION_COLUMN) |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
1094 |
column.set_resizable(True) |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
1095 |
column.set_sort_indicator(True) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
1096 |
column.set_cell_data_func(description_renderer, |
483 | 1097 |
self.cell_data_function, None) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1098 |
column.connect_after('clicked', |
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1099 |
self.__application_treeview_column_sorted, None) |
483 | 1100 |
self.w_application_treeview.append_column(column) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1101 |
#Added selection listener |
483 | 1102 |
self.package_selection = self.w_application_treeview.get_selection() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1103 |
self.application_list = application_list |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1104 |
self.application_list_filter = application_list_filter |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1105 |
self.application_list_sort = application_list_sort |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1106 |
toggle_renderer.connect('toggled', self.__active_pane_toggle, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1107 |
application_list_sort) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1108 |
|
1093
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1109 |
def __init_tree_views(self, application_list, category_list, |
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1110 |
section_list, application_list_filter = None, |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1111 |
application_list_sort = None, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1112 |
application_sort_column = enumerations.NAME_COLUMN): |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1113 |
'''This function connects treeviews with their models and also applies |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1114 |
filters''' |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1115 |
if category_list == None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1116 |
self.w_application_treeview.set_model(None) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1117 |
self.__remove_treeview_columns(self.w_application_treeview) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1118 |
elif application_list == None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1119 |
self.w_categories_treeview.set_model(None) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1120 |
self.__remove_treeview_columns(self.w_categories_treeview) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1121 |
else: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1122 |
self.__disconnect_models() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1123 |
self.__remove_treeview_columns(self.w_application_treeview) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1124 |
self.__remove_treeview_columns(self.w_categories_treeview) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1125 |
# The logic for set section needs to be here as some sections |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1126 |
# might be not enabled. In such situation we are setting the set |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1127 |
# section to "All Categories" one. |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1128 |
if section_list != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1129 |
row = section_list[self.set_section] |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1130 |
if row[enumerations.SECTION_ENABLED] and \ |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1131 |
self.set_section >= 0 and \ |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1132 |
self.set_section < len(section_list): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1133 |
if row[enumerations.SECTION_ID] != self.set_section: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1134 |
self.set_section = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1135 |
else: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1136 |
self.set_section = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1137 |
|
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1138 |
if application_list != None: |
1093
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
1139 |
self.__init_application_tree_view(application_list, |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1140 |
application_list_filter, application_list_sort, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1141 |
application_sort_column) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1142 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1143 |
if self.first_run: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1144 |
# When vadj changes we need to set image descriptions |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1145 |
# on visible status icons. This catches moving the scroll bars |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1146 |
# and scrolling up and down using keyboard. |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1147 |
vadj = self.w_application_treeview.get_vadjustment() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1148 |
vadj.connect('value-changed', |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1149 |
self.__application_treeview_vadjustment_changed, None) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1150 |
vadj = self.w_categories_treeview.get_vadjustment() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1151 |
vadj.connect('value-changed', |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1152 |
self.__categories_treeview_vadjustment_changed, None) |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1153 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1154 |
# When the size of the application_treeview changes |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1155 |
# we need to set image descriptions on visible status icons. |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1156 |
self.w_application_treeview.connect('size-allocate', |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1157 |
self.__application_treeview_size_allocate, None) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1158 |
self.w_categories_treeview.connect('size-allocate', |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1159 |
self.__categories_treeview_size_allocate, None) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1160 |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1161 |
if category_list != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1162 |
##CATEGORIES TREEVIEW |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1163 |
#enumerations.CATEGORY_NAME |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1164 |
category_list_filter = category_list.filter_new() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1165 |
column = self.__create_icon_column("", False, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1166 |
enumerations.CATEGORY_ICON, False) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1167 |
self.w_categories_treeview.append_column(column) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1168 |
enumerations.CATEGORY_NAME_renderer = gtk.CellRendererText() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1169 |
column = gtk.TreeViewColumn(_('Name'), |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1170 |
enumerations.CATEGORY_NAME_renderer, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1171 |
text = enumerations.CATEGORY_NAME) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1172 |
self.w_categories_treeview.append_column(column) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1173 |
#Added selection listener |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1174 |
category_selection = self.w_categories_treeview.get_selection() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1175 |
category_selection.set_mode(gtk.SELECTION_SINGLE) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1176 |
|
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1177 |
if self.first_run: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1178 |
##SECTION COMBOBOX |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1179 |
#enumerations.SECTION_NAME |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1180 |
cell = gtk.CellRendererText() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1181 |
self.w_sections_combobox.pack_start(cell, True) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
1182 |
self.w_sections_combobox.add_attribute(cell, 'text', |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1183 |
enumerations.SECTION_NAME) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
1184 |
self.w_sections_combobox.set_row_separator_func( |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1185 |
self.combobox_id_separator) |
892 | 1186 |
self.w_sections_combobox.add_attribute( cell, |
1187 |
'sensitive', enumerations.SECTION_ENABLED ) |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1188 |
##FILTER COMBOBOX |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1189 |
render_pixbuf = gtk.CellRendererPixbuf() |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1190 |
self.w_filter_combobox.pack_start(render_pixbuf, expand = True) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1191 |
self.w_filter_combobox.add_attribute(render_pixbuf, "pixbuf", |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1192 |
enumerations.FILTER_ICON) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1193 |
self.w_filter_combobox.set_cell_data_func(render_pixbuf, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1194 |
self.filter_cell_data_function, enumerations.FILTER_ICON) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1195 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1196 |
cell = gtk.CellRendererText() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1197 |
self.w_filter_combobox.pack_start(cell, True) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
1198 |
self.w_filter_combobox.add_attribute(cell, 'text', |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1199 |
enumerations.FILTER_NAME) |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1200 |
self.w_filter_combobox.set_cell_data_func(cell, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1201 |
self.filter_cell_data_function, enumerations.FILTER_NAME) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
1202 |
self.w_filter_combobox.set_row_separator_func( |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1203 |
self.combobox_filter_id_separator) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1204 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1205 |
if section_list != None: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1206 |
self.section_list = section_list |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1207 |
if category_list != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1208 |
self.category_list = category_list |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1209 |
self.category_list_filter = category_list_filter |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1210 |
self.w_categories_treeview.set_model(category_list_filter) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1211 |
if not self.is_search_all: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1212 |
category_list_filter.set_visible_func( |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1213 |
self.category_filter) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1214 |
self.__set_categories_visibility(self.set_section) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1215 |
self.a11y_categories_treeview = \ |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1216 |
self.w_categories_treeview.get_accessible() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1217 |
if application_list != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1218 |
if category_list != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1219 |
self.w_sections_combobox.set_model(section_list) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1220 |
self.w_sections_combobox.set_active(self.set_section) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1221 |
self.w_filter_combobox.set_model(self.filter_list) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1222 |
self.w_filter_combobox.set_active(self.set_show_filter) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1223 |
self.w_application_treeview.set_model( |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1224 |
self.application_list_sort) |
1212
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1225 |
if application_list_filter == None: |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1226 |
self.application_list_filter.set_visible_func( |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1227 |
self.__application_filter) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1228 |
|
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
1229 |
category_selection = self.w_categories_treeview.get_selection() |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
1230 |
category_model, category_iter = category_selection.get_selected() |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
1231 |
self.pylintstub = category_model |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1232 |
if not category_iter and not self.in_search_mode: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1233 |
#no category was selected, so select "All" |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
1234 |
category_selection.select_path(0) |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
1235 |
category_model, category_iter = category_selection.get_selected() |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1236 |
if self.first_run: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1237 |
category_selection.connect("changed", |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1238 |
self.__on_category_selection_changed, None) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1239 |
self.w_categories_treeview.connect("row-activated", |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1240 |
self.__on_category_row_activated, None) |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
1241 |
self.w_categories_treeview.connect("focus-in-event", |
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
1242 |
self.__on_category_focus_in, None) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1243 |
self.package_selection.set_mode(gtk.SELECTION_SINGLE) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1244 |
self.package_selection.connect("changed", |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1245 |
self.__on_package_selection_changed, None) |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1246 |
|
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1247 |
self.a11y_application_treeview = \ |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1248 |
self.w_application_treeview.get_accessible() |
892 | 1249 |
self.process_package_list_end() |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1250 |
|
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1251 |
def __categories_treeview_size_allocate(self, widget, allocation, user_data): |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1252 |
# We ignore any changes in the size during initialization. |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1253 |
if self.categories_treeview_initialized: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1254 |
if self.categories_status_id == 0: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1255 |
self.categories_status_id = gobject.idle_add( |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1256 |
self.__set_accessible_categories_visible_status) |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1257 |
|
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1258 |
def __categories_treeview_vadjustment_changed(self, widget, user_data): |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1259 |
self.__set_accessible_categories_visible_status() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1260 |
|
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1261 |
def __set_accessible_categories_status(self, model, itr): |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1262 |
status = model.get_value(itr, enumerations.CATEGORY_ICON) |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1263 |
if status != None: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1264 |
desc = _("Updates Available") |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1265 |
else: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1266 |
desc = None |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1267 |
if desc != None: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1268 |
obj = self.a11y_categories_treeview.ref_at( |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1269 |
int(model.get_string_from_iter(itr)), |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1270 |
CATEGORIES_STATUS_COLUMN_INDEX) |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1271 |
obj.set_image_description(desc) |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1272 |
|
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1273 |
def __set_accessible_categories_visible_status(self): |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1274 |
self.categories_status_id = 0 |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1275 |
if self.a11y_categories_treeview.get_n_accessible_children() == 0: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1276 |
# accessibility is not enabled |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1277 |
return |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1278 |
|
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1279 |
visible_range = self.w_categories_treeview.get_visible_range() |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1280 |
if visible_range == None: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1281 |
return |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1282 |
start = visible_range[0][0] |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1283 |
end = visible_range[1][0] |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1284 |
# We try to minimize the range of accessible objects |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1285 |
# on which we set image descriptions |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1286 |
if self.categories_treeview_range != None: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1287 |
old_start = self.categories_treeview_range[0][0] |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1288 |
old_end = self.categories_treeview_range[1][0] |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1289 |
# Old range is the same or smaller than new range |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1290 |
# so do nothing |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1291 |
if start >= old_start and end <= old_end: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1292 |
return |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1293 |
if start < old_end: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1294 |
if end < old_end: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1295 |
if end >= old_start: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1296 |
end = old_start |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1297 |
else: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1298 |
start = old_end |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1299 |
self.categories_treeview_range = visible_range |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1300 |
model = self.category_list_filter |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1301 |
itr = model.get_iter_from_string(str(start)) |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1302 |
while start <= end: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1303 |
start += 1 |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1304 |
self.__set_accessible_categories_status(model, itr) |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1305 |
itr = model.iter_next(itr) |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1306 |
|
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1307 |
def __application_treeview_column_sorted(self, widget, user_data): |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1308 |
self.__set_visible_status(False) |
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1309 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1310 |
def __init_repository_tree_view(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1311 |
cell = gtk.CellRendererText() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1312 |
self.w_repository_combobox.pack_start(cell, True) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1313 |
self.w_repository_combobox.add_attribute(cell, 'text', |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1314 |
enumerations.REPOSITORY_NAME) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1315 |
self.w_repository_combobox.set_row_separator_func( |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1316 |
self.combobox_id_separator) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1317 |
|
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1318 |
def __application_treeview_size_allocate(self, widget, allocation, user_data): |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1319 |
# We ignore any changes in the size during initialization. |
924
500d7c30cac7
7049 Accessible descriptions for images in "Status" column broken by rev 882
Padraig O'Briain <padraig.obriain@sun.com>
parents:
917
diff
changeset
|
1320 |
if self.visible_status_id == 0: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1321 |
self.visible_status_id = gobject.idle_add( |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1322 |
self.__set_visible_status) |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1323 |
|
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1324 |
def __application_treeview_vadjustment_changed(self, widget, user_data): |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1325 |
self.__set_visible_status() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1326 |
|
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1327 |
def __set_accessible_status(self, model, itr): |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1328 |
status = model.get_value(itr, enumerations.STATUS_COLUMN) |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1329 |
if status == enumerations.INSTALLED: |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1330 |
desc = _("Installed") |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1331 |
elif status == enumerations.NOT_INSTALLED: |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1332 |
desc = _("Not Installed") |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1333 |
elif status == enumerations.UPDATABLE: |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1334 |
desc = _("Updates Available") |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1335 |
else: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1336 |
desc = None |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1337 |
if desc != None: |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1338 |
obj = self.a11y_application_treeview.ref_at( |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1339 |
int(model.get_string_from_iter(itr)), |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1340 |
STATUS_COLUMN_INDEX) |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1341 |
obj.set_image_description(desc) |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1342 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1343 |
def __set_visible_status(self, check_range = True): |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1344 |
self.visible_status_id = 0 |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1345 |
if self.w_main_view_notebook.get_current_page() != \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1346 |
NOTEBOOK_PACKAGE_LIST_PAGE: |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1347 |
return |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1348 |
if self.__doing_search(): |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1349 |
return |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1350 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1351 |
a11y_enabled = False |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1352 |
if self.a11y_application_treeview.get_n_accessible_children() != 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1353 |
a11y_enabled = True |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1354 |
|
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1355 |
visible_range = self.w_application_treeview.get_visible_range() |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1356 |
if visible_range == None: |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1357 |
return |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1358 |
start = visible_range[0][0] |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1359 |
end = visible_range[1][0] |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1360 |
if debug_descriptions: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1361 |
print "Range Start: %d End: %d" % (start, end) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1362 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1363 |
# Switching Publishers need to use default range |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1364 |
if self.publisher_changed: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1365 |
check_range = False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1366 |
self.publisher_changed = False |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1367 |
if self.in_search_mode: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1368 |
check_range = False |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1369 |
|
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1370 |
if self.application_treeview_range != None: |
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1371 |
if check_range: |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1372 |
old_start = self.application_treeview_range[0][0] |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1373 |
old_end = self.application_treeview_range[1][0] |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1374 |
# Old range is the same or smaller than new range |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1375 |
# so do nothing |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1376 |
if start >= old_start and end <= old_end: |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1377 |
return |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1378 |
if start < old_end: |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1379 |
if end < old_end: |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1380 |
if end >= old_start: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1381 |
end = old_start |
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1382 |
else: |
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
1383 |
start = old_end |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1384 |
if debug_descriptions: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1385 |
print "Adjusted Range Start: %d End: %d" % (start, end) |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1386 |
self.application_treeview_range = visible_range |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1387 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1388 |
sort_filt_model = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1389 |
self.w_application_treeview.get_model() #gtk.TreeModelSort |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1390 |
filt_model = sort_filt_model.get_model() #gtk.TreeModelFilter |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1391 |
model = filt_model.get_model() #gtk.ListStore |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1392 |
sf_itr = sort_filt_model.get_iter_from_string(str(start)) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1393 |
pkg_stems_and_itr_to_fetch = {} |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1394 |
while start <= end: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1395 |
filtered_itr = sort_filt_model.convert_iter_to_child_iter(None, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1396 |
sf_itr) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1397 |
app_itr = filt_model.convert_iter_to_child_iter(filtered_itr) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1398 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1399 |
desc = sort_filt_model.get_value(sf_itr, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1400 |
enumerations.DESCRIPTION_COLUMN) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1401 |
# Only Fetch description for packages without a |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1402 |
# description |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1403 |
if desc == '...': |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1404 |
pkg_fmri = sort_filt_model.get_value(sf_itr, |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1405 |
enumerations.FMRI_COLUMN) |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1406 |
if pkg_fmri != None: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1407 |
pkg_stem = pkg_fmri.get_pkg_stem( |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1408 |
include_scheme = True) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1409 |
pkg_stems_and_itr_to_fetch[pkg_stem] = \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1410 |
model.get_string_from_iter(app_itr) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1411 |
if a11y_enabled: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1412 |
self.__set_accessible_status(sort_filt_model, sf_itr) |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1413 |
start += 1 |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1414 |
sf_itr = sort_filt_model.iter_next(sf_itr) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1415 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1416 |
if debug_descriptions: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1417 |
print "PKGS to FETCH: \n%s" % pkg_stems_and_itr_to_fetch |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1418 |
if len(pkg_stems_and_itr_to_fetch) > 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1419 |
Thread(target = self.__get_pkg_descriptions, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1420 |
args = [pkg_stems_and_itr_to_fetch, model]).start() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1421 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1422 |
def __doing_search(self): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1423 |
return self.search_start > 0 |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1424 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1425 |
def __get_pkg_descriptions(self, pkg_stems_and_itr_to_fetch, orig_model): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1426 |
# Note: no need to aquire lock even though this can be called from |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1427 |
# multiple threads, it is just creating an update job and dispatching it |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1428 |
# to the idle handler, not modifying any global state |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1429 |
info = None |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1430 |
if not self.__doing_search(): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1431 |
gobject.idle_add(self.__update_statusbar_message, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1432 |
_("Fetching descriptions...")) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1433 |
try: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1434 |
info = self.api_o.info(pkg_stems_and_itr_to_fetch.keys(), False, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1435 |
frozenset([api.PackageInfo.IDENTITY, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1436 |
api.PackageInfo.SUMMARY])) |
1191
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
1437 |
except api_errors.TransportError: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1438 |
self.update_statusbar() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1439 |
return |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1440 |
if info and len(info.get(0)) == 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1441 |
self.update_statusbar() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1442 |
return |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1443 |
pkg_infos = info.get(0) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1444 |
pkg_descriptions_for_update = [] |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1445 |
for pkg_info in pkg_infos: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1446 |
short_fmri = fmri.PkgFmri(pkg_info.fmri).get_pkg_stem( |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1447 |
include_scheme = True) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1448 |
pkg_descriptions_for_update.append((short_fmri, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1449 |
pkg_stems_and_itr_to_fetch[short_fmri], |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1450 |
pkg_info.summary)) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1451 |
if debug_descriptions: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1452 |
print "FETCHED PKGS: \n%s" % pkg_descriptions_for_update |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1453 |
gobject.idle_add(self.__update_description_from_iter, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1454 |
pkg_descriptions_for_update, orig_model) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1455 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1456 |
def __update_description_from_iter(self, pkg_descriptions_for_update, orig_model): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1457 |
sort_filt_model = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1458 |
self.w_application_treeview.get_model() #gtk.TreeModelSort |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1459 |
filt_model = sort_filt_model.get_model() #gtk.TreeModelFilter |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1460 |
model = filt_model.get_model() #gtk.ListStore |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1461 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1462 |
#If model has changed abandon description updates |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1463 |
if orig_model != model: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1464 |
return |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1465 |
|
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1466 |
#If doing a search abandon description updates |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1467 |
if self.__doing_search(): |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1468 |
return |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1469 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1470 |
if debug_descriptions: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1471 |
print "UPDATE DESCRIPTIONS: \n%s" % pkg_descriptions_for_update |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1472 |
for pkg_stem, path, summary in pkg_descriptions_for_update: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1473 |
itr = model.get_iter_from_string(path) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1474 |
stored_pkg_fmri = model.get_value(itr, enumerations.FMRI_COLUMN) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1475 |
stored_pkg_stem = stored_pkg_fmri.get_pkg_stem( |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1476 |
include_scheme = True) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1477 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1478 |
if pkg_stem != stored_pkg_stem: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1479 |
if debug: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1480 |
print ("__update_description_from_iter(): " |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1481 |
"model not consistent so abandoning " |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1482 |
"these description updates.") |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1483 |
self.update_statusbar() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1484 |
return |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1485 |
model.set_value(itr, enumerations.DESCRIPTION_COLUMN, summary) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1486 |
if not self.__doing_search(): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1487 |
self.update_statusbar() |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1488 |
|
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1489 |
def __create_icon_column(self, name, expand_pixbuf, enum_value, set_data_func): |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1490 |
column = gtk.TreeViewColumn() |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1491 |
column.set_title(name) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1492 |
#Commented, since there was funny jumping of the icons |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1493 |
#column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1494 |
render_pixbuf = gtk.CellRendererPixbuf() |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1495 |
column.pack_start(render_pixbuf, expand = expand_pixbuf) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1496 |
column.add_attribute(render_pixbuf, "pixbuf", enum_value) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1497 |
column.set_fixed_width(32) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1498 |
if set_data_func: |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1499 |
column.set_cell_data_func(render_pixbuf, |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1500 |
self.cell_data_function, None) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1501 |
return column |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1502 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1503 |
def __disconnect_models(self): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1504 |
self.w_application_treeview.set_model(None) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1505 |
self.w_categories_treeview.set_model(None) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1506 |
self.w_sections_combobox.set_model(None) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1507 |
self.w_filter_combobox.set_model(None) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1508 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1509 |
def __disconnect_repository_model(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1510 |
self.w_repository_combobox.set_model(None) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1511 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1512 |
@staticmethod |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
1513 |
def __status_sort_func(treemodel, iter1, iter2, user_data=None): |
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
1514 |
get_val = treemodel.get_value |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
1515 |
status1 = get_val(iter1, enumerations.STATUS_COLUMN) |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
1516 |
status2 = get_val(iter2, enumerations.STATUS_COLUMN) |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
1517 |
return cmp(status1, status2) |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
1518 |
|
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
1519 |
@staticmethod |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1520 |
def __remove_treeview_columns(treeview): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1521 |
columns = treeview.get_columns() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1522 |
if columns: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1523 |
for column in columns: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1524 |
treeview.remove_column(column) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1525 |
|
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
1526 |
@staticmethod |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
1527 |
def __init_sections(section_list): |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1528 |
'''This function is for initializing sections combo box, also adds "All" |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1529 |
Category. It sets active section combobox entry "All"''' |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
1530 |
cat_path = None |
892 | 1531 |
enabled = True |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
1532 |
# We enable only first section and later we might enable the rest, |
892 | 1533 |
# depending if there are some packages connected with them |
1534 |
section_list.append([0, _('All Categories'), cat_path, enabled ]) |
|
1535 |
section_list.append([-1, "", cat_path, enabled ]) |
|
1536 |
enabled = False |
|
1537 |
section_list.append([2, _('Meta Packages'), cat_path, enabled ]) |
|
1538 |
section_list.append([3, _('Applications'), cat_path, enabled ]) |
|
1539 |
section_list.append([4, _('Desktop (GNOME)'), cat_path, enabled ]) |
|
1540 |
section_list.append([5, _('Development'), cat_path, enabled ]) |
|
1541 |
section_list.append([6, _('Distributions'), cat_path, enabled ]) |
|
1542 |
section_list.append([7, _('Drivers'), cat_path, enabled ]) |
|
1543 |
section_list.append([8, _('System'), cat_path, enabled ]) |
|
1544 |
section_list.append([9, _('Web Services'), cat_path, enabled ]) |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
1545 |
|
483 | 1546 |
def __init_show_filter(self): |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1547 |
max_length = 0 |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1548 |
for filter_id, pixbuf, label in self.filter_options: |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1549 |
self.filter_list.append([filter_id, pixbuf, label, ]) |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1550 |
if filter_id == -1: |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1551 |
continue |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1552 |
max_length = self.__get_max_text_length( |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1553 |
max_length, label, self.w_filter_combobox) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1554 |
|
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
1555 |
if self.initial_show_filter >= enumerations.FILTER_ALL and \ |
892 | 1556 |
self.initial_show_filter < len(self.filter_list): |
1557 |
row = self.filter_list[self.initial_show_filter] |
|
1558 |
if row[enumerations.SECTION_ID] != self.initial_show_filter: |
|
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
1559 |
self.initial_show_filter = enumerations.FILTER_ALL |
821
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
1560 |
else: |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
1561 |
self.initial_show_filter = enumerations.FILTER_ALL |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1562 |
return max_length |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1563 |
|
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1564 |
@staticmethod |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1565 |
def __get_max_text_length(length_to_check, text, widget): |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1566 |
if widget == None: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1567 |
return 0 |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1568 |
context = widget.get_pango_context() |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1569 |
metrics = context.get_metrics(context.get_font_description()) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1570 |
current_length = pango.PIXELS( |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1571 |
metrics.get_approximate_char_width() * len(text)) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1572 |
if current_length > length_to_check: |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1573 |
return current_length |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1574 |
else: |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
1575 |
return length_to_check |
483 | 1576 |
|
1577 |
def __on_cancel_progressdialog_clicked(self, widget): |
|
1578 |
self.progress_canceled = True |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
1579 |
self.progress_stop_timer_thread = True |
483 | 1580 |
|
1216
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
1581 |
def __on_mainwindow_key_press_event(self, widget, event): |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
1582 |
if self.is_busy_cursor_set(): |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
1583 |
return True |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
1584 |
else: |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
1585 |
return False |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
1586 |
|
483 | 1587 |
def __on_mainwindow_delete_event(self, widget, event): |
1588 |
''' handler for delete event of the main window ''' |
|
1589 |
if self.__check_if_something_was_changed() == True: |
|
1590 |
# XXX Change this to not quit and show dialog |
|
1591 |
# XXX if some changes were applied: |
|
1592 |
self.__main_application_quit() |
|
1593 |
return True |
|
1594 |
else: |
|
1595 |
self.__main_application_quit() |
|
1596 |
||
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1597 |
def __on_api_search_error_delete_event(self, widget, event): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1598 |
self.__on_api_search_button_clicked(None) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1599 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1600 |
def __on_api_search_button_clicked(self, widget): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1601 |
self.api_search_error_dialog.hide() |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
1602 |
|
483 | 1603 |
def __on_file_quit_activate(self, widget): |
1604 |
''' handler for quit menu event ''' |
|
1605 |
self.__on_mainwindow_delete_event(None, None) |
|
1606 |
||
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
1607 |
def __on_ua_completed_close(self, widget): |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
1608 |
self.w_ua_completed_dialog.hide() |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
1609 |
self.__on_mainwindow_delete_event(None, None) |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
1610 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1611 |
def __on_edit_repositories_activate(self, widget): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1612 |
''' handler for repository menu event ''' |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1613 |
repository.Repository(self) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1614 |
|
543
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
1615 |
def __on_file_be_activate(self, widget): |
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
1616 |
''' handler for be menu event ''' |
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
1617 |
beadm.Beadmin(self) |
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
1618 |
|
483 | 1619 |
def __on_searchentry_changed(self, widget): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1620 |
if widget.get_text_length() > 0: |
894
16698758b366
6974 Behavior of Clear Search (Brush Icon)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
893
diff
changeset
|
1621 |
self.w_clear_search_button.set_sensitive(True) |
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
1622 |
self.w_clear_search_menuitem.set_sensitive(True) |
894
16698758b366
6974 Behavior of Clear Search (Brush Icon)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
893
diff
changeset
|
1623 |
else: |
16698758b366
6974 Behavior of Clear Search (Brush Icon)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
893
diff
changeset
|
1624 |
self.w_clear_search_button.set_sensitive(False) |
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
1625 |
self.w_clear_search_menuitem.set_sensitive(False) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1626 |
self.__enable_disable_entry_selection(widget) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1627 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1628 |
def __update_statusbar_for_search(self): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1629 |
self.__update_statusbar_message( |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1630 |
self.search_options[self.current_search_option][3]) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1631 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1632 |
def __update_statusbar_message(self, message): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1633 |
if self.statusbar_message_id > 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1634 |
self.w_main_statusbar.remove(0, self.statusbar_message_id) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1635 |
self.statusbar_message_id = 0 |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1636 |
self.statusbar_message_id = self.w_main_statusbar.push(0, message) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1637 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1638 |
def __setup_before_search_all_mode(self): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1639 |
self.is_search_all = True |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1640 |
self.w_infosearch_frame.hide() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1641 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1642 |
self.__save_setup_before_search() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1643 |
self.w_repository_combobox.set_active(0) |
1212
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1644 |
self.__clear_before_search() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1645 |
self.__update_statusbar_for_search() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1646 |
self.w_searchentry.grab_focus() |
1212
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1647 |
if self.w_searchentry.get_text_length() > 0: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1648 |
start, end = self.w_searchentry.get_selection_bounds() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1649 |
self.w_searchentry.select_region(end, end) |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1650 |
self.pylintstub = start |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1651 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1652 |
def __clear_before_search(self): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1653 |
self.in_setup = True |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1654 |
application_list = self.__get_new_application_liststore() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1655 |
self.__set_empty_details_panel() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1656 |
self.__set_main_view_package_list() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1657 |
self.__init_tree_views(application_list, None, None) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1658 |
self.__unselect_category() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1659 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1660 |
def __restore_setup_for_browse(self): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1661 |
self.in_search_mode = False |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1662 |
self.is_search_all = False |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1663 |
self.w_infosearch_frame.hide() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1664 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1665 |
self.set_busy_cursor() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1666 |
self.w_repository_combobox.set_active( |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1667 |
self.saved_repository_combobox_active) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1668 |
self.set_section = self.saved_sections_combobox_active |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1669 |
if self.saved_category_list == self.category_list: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1670 |
self.__init_tree_views(self.saved_application_list, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1671 |
None, None, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1672 |
self.saved_application_list_filter, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1673 |
self.saved_application_list_sort) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1674 |
else: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1675 |
self.__init_tree_views(self.saved_application_list, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1676 |
self.saved_category_list, self.saved_section_list, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1677 |
self.saved_application_list_filter, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1678 |
self.saved_application_list_sort) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1679 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1680 |
self.__set_main_view_package_list() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1681 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1682 |
def __save_setup_before_search(self, single_search=False): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1683 |
#Do not save search data models |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1684 |
if self.in_search_mode: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1685 |
return |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1686 |
self.saved_sections_combobox_active = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1687 |
self.w_sections_combobox.get_active() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1688 |
self.saved_application_list = self.application_list |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1689 |
self.saved_application_list_sort = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1690 |
self.application_list_sort |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1691 |
self.saved_application_list_filter = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1692 |
self.application_list_filter |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1693 |
self.saved_category_list = self.category_list |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1694 |
self.saved_section_list = self.section_list |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1695 |
if single_search: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1696 |
self.saved_repository_combobox_active = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1697 |
self.w_repository_combobox.get_active() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1698 |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
1699 |
def __do_search(self): |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1700 |
self.search_start = 0 |
1212
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1701 |
if self.changing_search_option or \ |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1702 |
self.w_searchentry.get_text_length() == 0: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1703 |
return |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1704 |
if not self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1705 |
self.__save_setup_before_search(single_search=True) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1706 |
self.__clear_before_search() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1707 |
self.set_busy_cursor() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1708 |
self.in_search_mode = True |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1709 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1710 |
self.w_infosearch_frame.hide() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1711 |
self.__update_statusbar_message(_("Searching...")) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1712 |
if not self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1713 |
Thread(target = self.__do_api_search, |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1714 |
args = (self.is_search_all, )).start() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1715 |
else: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1716 |
Thread(target = self.__do_api_search, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1717 |
args = ()).start() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1718 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1719 |
def __unselect_category(self): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1720 |
selection = self.w_categories_treeview.get_selection() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1721 |
model, itr = selection.get_selected() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1722 |
if itr: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1723 |
cat_path = model.get_string_from_iter(itr) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1724 |
selected_section = self.w_sections_combobox.get_active() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1725 |
section_row = self.section_list[selected_section] |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1726 |
section_row[enumerations.SECTION_SUBCATEGORY] = cat_path |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1727 |
selection.unselect_all() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1728 |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1729 |
def __process_after_search_failure(self): |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1730 |
self.search_start = 0 |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1731 |
self.search_time_sec = 0 |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1732 |
self.application_list = [] |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1733 |
self.update_statusbar() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1734 |
self.unset_busy_cursor() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1735 |
self.in_setup = False |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1736 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1737 |
@staticmethod |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1738 |
def __get_origin_uri(repo): |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1739 |
if repo == None: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1740 |
return None |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1741 |
origin_uri = repo.origins[0] |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1742 |
ret_uri = None |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1743 |
if isinstance(origin_uri, str): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1744 |
if len(origin_uri) > 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1745 |
ret_uri = origin_uri.strip("/") |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1746 |
elif isinstance(origin_uri, publisher.RepositoryURI): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1747 |
uri = origin_uri.uri |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1748 |
if uri != None and len(uri) > 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1749 |
ret_uri = uri.strip("/") |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1750 |
return ret_uri |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1751 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1752 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1753 |
def __do_api_search(self, search_all = True): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1754 |
self.search_start = time.time() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1755 |
self.search_time_sec = 0 |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1756 |
text = self.w_searchentry.get_text() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1757 |
# Here we call the search API to get the results |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1758 |
searches = [] |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1759 |
servers = [] |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1760 |
result = [] |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1761 |
pargs = [] |
1070
7c1f067af2d8
8289 PM search against all repos is x5 slower than the CLI
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1062
diff
changeset
|
1762 |
search_str = SEARCH_STR_FORMAT % text |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1763 |
pargs.append(search_str) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1764 |
if search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1765 |
servers = None |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1766 |
else: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1767 |
pub_prefix = self.__get_selected_publisher() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1768 |
if pub_prefix != None: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1769 |
pub = self.api_o.get_publisher(prefix=pub_prefix) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1770 |
else: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1771 |
pub = self.api_o.get_preferred_publisher() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1772 |
origin_uri = self.__get_origin_uri(pub.selected_repository) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1773 |
servers.append({"origin": origin_uri}) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1774 |
if debug: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1775 |
print "Search: pargs %s servers: %s" % (pargs, servers) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1776 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1777 |
#TBD If we ever search just Installed pkgs should allow for a local search |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1778 |
case_sensitive = False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1779 |
return_actions = True |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1780 |
searches.append(self.api_o.remote_search( |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1781 |
[api.Query(" ".join(pargs), case_sensitive, return_actions)], |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1782 |
servers=servers)) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1783 |
if debug: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1784 |
print "Search Args: %s : cs: %s : retact: %s" % \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1785 |
("".join(pargs), case_sensitive, return_actions) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1786 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1787 |
last_name = "" |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1788 |
self.search_all_pub_being_searched = None |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1789 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1790 |
# Sorting results by Name gives best overall appearance and flow |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1791 |
sort_col = enumerations.NAME_COLUMN |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1792 |
try: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1793 |
for query_num, pub, (v, return_type, tmp) in \ |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1794 |
itertools.chain(*searches): |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1795 |
if v < 1 or return_type != api.Query.RETURN_PACKAGES: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1796 |
gobject.idle_add(self.w_progress_dialog.hide) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1797 |
self.__process_after_search_failure() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1798 |
return |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1799 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1800 |
active_pub = None |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1801 |
if pub is not None \ |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1802 |
and "prefix" in pub: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1803 |
active_pub = pub["prefix"] |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1804 |
name = fmri.PkgFmri(str(tmp)).get_name() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1805 |
if last_name != name: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1806 |
if debug: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1807 |
print "Result Name: %s (%s)" \ |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1808 |
% (name, active_pub) |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1809 |
a_res = name, active_pub |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1810 |
result.append(a_res) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1811 |
#Ignore Status when fetching |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1812 |
application_list = \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1813 |
self.__get_min_list_from_search(result) |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1814 |
self.search_all_pub_being_searched = active_pub |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1815 |
self.in_setup = True |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1816 |
gobject.idle_add(self.__init_tree_views, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1817 |
application_list, None, None, None, None, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1818 |
sort_col) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1819 |
last_name = name |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1820 |
self.pylintstub = query_num |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1821 |
except api_errors.ProblematicSearchServers, ex: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1822 |
self.__process_api_search_error(ex) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1823 |
gobject.idle_add(self.w_progress_dialog.hide) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1824 |
gobject.idle_add(self.__handle_api_search_error) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1825 |
if len(result) == 0: |
1074
f6b6a4290aa2
8335 Search All Repositories should match CLI default search behavior
John Rice <john.rice@sun.com>
parents:
1071
diff
changeset
|
1826 |
self.__process_after_search_with_zero_results() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1827 |
return |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1828 |
except Exception, ex: |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
1829 |
# We are not interested in this error |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1830 |
gobject.idle_add(self.w_progress_dialog.hide) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1831 |
self.__process_after_search_failure() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1832 |
return |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1833 |
if debug: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1834 |
print "Number of search results:", len(result) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1835 |
if len(result) == 0: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1836 |
if debug: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1837 |
print "No search results" |
1074
f6b6a4290aa2
8335 Search All Repositories should match CLI default search behavior
John Rice <john.rice@sun.com>
parents:
1071
diff
changeset
|
1838 |
self.__process_after_search_with_zero_results() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1839 |
return |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1840 |
# We cannot get status of the packages if catalogs have not |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1841 |
# been loaded so we pause for up to 5 seconds here to |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1842 |
# allow catalogs to be loaded |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1843 |
times = 5 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1844 |
while self.catalog_loaded == False: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1845 |
if times == 0: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1846 |
break |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1847 |
time.sleep(1) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1848 |
times -= 1 |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1849 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1850 |
#Now fetch full result set with Status |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1851 |
self.in_setup = True |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1852 |
application_list = self.__get_full_list_from_search(result) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1853 |
gobject.idle_add(self.__init_tree_views, application_list, None, None, \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1854 |
None, None, sort_col) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1855 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1856 |
if self.search_start > 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1857 |
self.search_time_sec = int(time.time() - self.search_start) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1858 |
if debug: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1859 |
print "Search time: %d (sec)" % self.search_time_sec |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1860 |
self.search_start = 0 |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1861 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1862 |
def __process_after_search_with_zero_results(self): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1863 |
if self.search_start > 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1864 |
self.search_time_sec = int(time.time() - self.search_start) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1865 |
self.search_start = 0 |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1866 |
self.in_setup = True |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1867 |
application_list = self.__get_new_application_liststore() |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
1868 |
gobject.idle_add(self.__set_empty_details_panel) |
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
1869 |
gobject.idle_add(self.__set_main_view_package_list) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1870 |
gobject.idle_add(self.__init_tree_views, application_list, None, None) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1871 |
|
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1872 |
def __get_min_list_from_search(self, search_result): |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1873 |
application_list = self.__get_new_application_liststore() |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1874 |
for name, pub in search_result: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1875 |
application_list.append( |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1876 |
[False, None, name, '...', enumerations.NOT_INSTALLED, None, |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1877 |
"pkg://" + pub + "/" + name, None, True, None, |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1878 |
pub]) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1879 |
return application_list |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1880 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
1881 |
def __get_full_list_from_search(self, search_result): |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1882 |
application_list = self.__get_new_application_liststore() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1883 |
self.__add_pkgs_to_list_from_search(search_result, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1884 |
application_list) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1885 |
return application_list |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1886 |
|
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1887 |
def __add_pkgs_to_list_from_search(self, search_result, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1888 |
application_list): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1889 |
pargs = [] |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1890 |
for name, pub in search_result: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
1891 |
pargs.append("pkg://" + pub + "/" + name) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1892 |
# We now need to get the status for each package |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1893 |
if debug_descriptions: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1894 |
print "pargs:", pargs |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1895 |
try: |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
1896 |
pkgs_known = self.__get_inventory_list(pargs, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1897 |
True, True) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1898 |
except api_errors.InventoryException: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1899 |
# This can happen if load_catalogs has not been run |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1900 |
err = _("Unable to get status for search results.\n" |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1901 |
"The catalogs have not been loaded.\n" |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
1902 |
"Please try after few seconds.\n") |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1903 |
gobject.idle_add(self.w_progress_dialog.hide) |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
1904 |
gobject.idle_add(self.error_occurred, err) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1905 |
return |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1906 |
return self.__add_pkgs_to_lists(pkgs_known, application_list, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1907 |
None, None) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1908 |
|
697 | 1909 |
def __application_refilter(self): |
793
0f219154d202
5526 Package Manager _very_ slow after UA "Screen R&M" turned on
Padraig O'Briain <padraig.obriain@sun.com>
parents:
791
diff
changeset
|
1910 |
''' Disconnecting the model from the treeview improves |
0f219154d202
5526 Package Manager _very_ slow after UA "Screen R&M" turned on
Padraig O'Briain <padraig.obriain@sun.com>
parents:
791
diff
changeset
|
1911 |
performance when assistive technologies are enabled''' |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1912 |
if self.in_setup: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
1913 |
return |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1914 |
self.application_refilter_id = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1915 |
self.application_refilter_idle_id = 0 |
1212
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1916 |
model = self.w_application_treeview.get_model() |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1917 |
self.w_application_treeview.set_model(None) |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1918 |
self.application_list_filter.refilter() |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1919 |
self.w_application_treeview.set_model(model) |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
1920 |
gobject.idle_add(self.__set_empty_details_panel) |
483 | 1921 |
gobject.idle_add(self.__enable_disable_selection_menus) |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
1922 |
gobject.idle_add(self.__enable_disable_install_remove) |
833
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1923 |
self.application_treeview_initialized = True |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1924 |
self.application_treeview_range = None |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1925 |
if self.visible_status_id == 0: |
9aef5ca23264
5914 Images in "Status" column need accessible descriptions
Padraig O'Briain <padraig.obriain@sun.com>
parents:
830
diff
changeset
|
1926 |
self.visible_status_id = gobject.idle_add( |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
1927 |
self.__set_visible_status) |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1928 |
self.categories_treeview_initialized = True |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1929 |
self.categories_treeview_range = None |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1930 |
if self.categories_status_id == 0: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1931 |
self.categories_status_id = gobject.idle_add( |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
1932 |
self.__set_accessible_categories_visible_status) |
697 | 1933 |
return False |
483 | 1934 |
|
1935 |
def __on_edit_paste(self, widget): |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1936 |
self.w_searchentry.paste_clipboard() |
483 | 1937 |
|
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
1938 |
def __on_delete(self, widget): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1939 |
bounds = self.w_searchentry.get_selection_bounds() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1940 |
self.w_searchentry.delete_text(bounds[0], bounds[1]) |
483 | 1941 |
return |
1942 |
||
1943 |
def __on_copy(self, widget): |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1944 |
focus_widget = self.w_main_window.get_focus() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1945 |
if focus_widget == self.w_searchentry: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1946 |
self.w_searchentry.copy_clipboard() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1947 |
self.w_paste_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1948 |
elif self.__is_a_textview(focus_widget): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1949 |
focus_widget.get_buffer().copy_clipboard( |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1950 |
self.w_main_clipboard) |
483 | 1951 |
|
1952 |
def __on_cut(self, widget): |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1953 |
self.w_searchentry.cut_clipboard() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1954 |
self.w_paste_menuitem.set_sensitive(True) |
483 | 1955 |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1956 |
def __popup_position_func(self, menu): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1957 |
''' Position popup menu immediately below search button''' |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1958 |
root = self.w_main_window.window.get_origin() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1959 |
alloc = self.search_button.get_allocation() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1960 |
return (root[0] + alloc.x, root[1] + alloc.y + alloc.height, False) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1961 |
|
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1962 |
def __on_set_search(self, widget, event): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1963 |
if event.type == gtk.gdk.BUTTON_PRESS: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1964 |
self.searchmenu.popup(None, None, self.__popup_position_func, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1965 |
event.button, event.time) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1966 |
return True |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1967 |
return False |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
1968 |
|
995
7ace85819158
7694 A mouse-click is necessary to change search options in packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
985
diff
changeset
|
1969 |
def __on_set_search_clicked(self, widget): |
7ace85819158
7694 A mouse-click is necessary to change search options in packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
985
diff
changeset
|
1970 |
self.searchmenu.popup(None, None, self.__popup_position_func, |
7ace85819158
7694 A mouse-click is necessary to change search options in packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
985
diff
changeset
|
1971 |
0, 0) |
7ace85819158
7694 A mouse-click is necessary to change search options in packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
985
diff
changeset
|
1972 |
return True |
7ace85819158
7694 A mouse-click is necessary to change search options in packagemanager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
985
diff
changeset
|
1973 |
|
1005
739eb81725b8
7824 Menus/shortcuts don't match HIG
John Rice <john.rice@sun.com>
parents:
996
diff
changeset
|
1974 |
def __on_edit_search_clicked(self, widget): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1975 |
self.w_searchentry.grab_focus() |
1005
739eb81725b8
7824 Menus/shortcuts don't match HIG
John Rice <john.rice@sun.com>
parents:
996
diff
changeset
|
1976 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1977 |
def __on_clear_search(self, widget): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
1978 |
self.w_searchentry.delete_text(0, -1) |
1212
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1979 |
# Only clear out search results |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1980 |
if self.in_search_mode or self.is_search_all: |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1981 |
self.__clear_before_search() |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
1982 |
self.__update_statusbar_message(_("Search cleared")) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1983 |
return |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
1984 |
|
866 | 1985 |
def __on_startpage(self, widget): |
1986 |
self.__load_startpage() |
|
1987 |
self.w_main_view_notebook.set_current_page(NOTEBOOK_START_PAGE) |
|
1988 |
||
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
1989 |
def __on_notebook_change(self, widget, event, pagenum): |
1049
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
1990 |
if (pagenum == INFO_NOTEBOOK_LICENSE_PAGE and |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
1991 |
not self.showing_empty_details): |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
1992 |
licbuffer = self.w_license_textview.get_buffer() |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
1993 |
leg_txt = _("Fetching legal information...") |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
1994 |
licbuffer.set_text(leg_txt) |
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
1995 |
if self.show_licenses_id != 0: |
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
1996 |
gobject.source_remove(self.show_licenses_id) |
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
1997 |
self.show_licenses_id = 0 |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
1998 |
self.last_show_licenses_id = self.show_licenses_id = \ |
1183
05f2a75fdcdf
9558 Support for typeahead search in Package Manager should be removed
John Rice <john.rice@sun.com>
parents:
1179
diff
changeset
|
1999 |
gobject.timeout_add(SHOW_LICENSE_DELAY, |
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
2000 |
self.__show_licenses) |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2001 |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2002 |
def __is_a_textview(self, widget): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2003 |
if (widget == self.w_generalinfo_textview or |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2004 |
widget == self.w_installedfiles_textview or |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2005 |
widget == self.w_dependencies_textview or |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2006 |
widget == self.w_license_textview): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2007 |
return True |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2008 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2009 |
return False |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2010 |
|
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2011 |
|
483 | 2012 |
def __on_select_all(self, widget): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2013 |
focus_widget = self.w_main_window.get_focus() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2014 |
if self.__is_a_textview(focus_widget): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2015 |
focus_widget.emit('select-all', True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2016 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2017 |
self.w_deselect_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2018 |
return |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2019 |
elif focus_widget == self.w_searchentry: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2020 |
focus_widget.select_region(0, -1) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2021 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2022 |
self.w_deselect_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2023 |
return |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2024 |
|
483 | 2025 |
sort_filt_model = \ |
2026 |
self.w_application_treeview.get_model() #gtk.TreeModelSort |
|
2027 |
filt_model = sort_filt_model.get_model() #gtk.TreeModelFilter |
|
2028 |
model = filt_model.get_model() #gtk.ListStore |
|
2029 |
iter_next = sort_filt_model.get_iter_first() |
|
2030 |
list_of_paths = [] |
|
2031 |
while iter_next != None: |
|
2032 |
sorted_path = sort_filt_model.get_path(iter_next) |
|
2033 |
filtered_path = \ |
|
2034 |
sort_filt_model.convert_path_to_child_path(sorted_path) |
|
2035 |
path = filt_model.convert_path_to_child_path(filtered_path) |
|
2036 |
list_of_paths.append(path) |
|
2037 |
iter_next = sort_filt_model.iter_next(iter_next) |
|
2038 |
for path in list_of_paths: |
|
2039 |
itr = model.get_iter(path) |
|
929
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2040 |
already_marked = model.get_value(itr, enumerations.MARK_COLUMN) |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2041 |
if not already_marked: |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2042 |
model.set_value(itr, enumerations.MARK_COLUMN, True) |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2043 |
pkg_stem = model.get_value(itr, |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2044 |
enumerations.STEM_COLUMN) |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2045 |
pkg_status = model.get_value(itr, |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2046 |
enumerations.STATUS_COLUMN) |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2047 |
self.__add_pkg_stem_to_list(pkg_stem, pkg_status) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2048 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2049 |
self.w_deselect_menuitem.set_sensitive(True) |
483 | 2050 |
self.__enable_disable_selection_menus() |
2051 |
self.update_statusbar() |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2052 |
self.__enable_disable_install_remove() |
483 | 2053 |
|
2054 |
def __on_select_updates(self, widget): |
|
2055 |
sort_filt_model = \ |
|
2056 |
self.w_application_treeview.get_model() #gtk.TreeModelSort |
|
2057 |
filt_model = sort_filt_model.get_model() #gtk.TreeModelFilter |
|
2058 |
model = filt_model.get_model() #gtk.ListStore |
|
2059 |
iter_next = sort_filt_model.get_iter_first() |
|
2060 |
list_of_paths = [] |
|
2061 |
while iter_next != None: |
|
2062 |
sorted_path = sort_filt_model.get_path(iter_next) |
|
2063 |
filtered_iter = sort_filt_model.convert_iter_to_child_iter(None, \ |
|
2064 |
iter_next) |
|
2065 |
app_iter = filt_model.convert_iter_to_child_iter(filtered_iter) |
|
2066 |
||
2067 |
filtered_path = \ |
|
2068 |
sort_filt_model.convert_path_to_child_path(sorted_path) |
|
2069 |
path = filt_model.convert_path_to_child_path(filtered_path) |
|
2070 |
if model.get_value(app_iter, \ |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2071 |
enumerations.STATUS_COLUMN) == enumerations.UPDATABLE: |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2072 |
list_of_paths.append(path) |
483 | 2073 |
iter_next = sort_filt_model.iter_next(iter_next) |
2074 |
for path in list_of_paths: |
|
2075 |
itr = model.get_iter(path) |
|
2076 |
model.set_value(itr, enumerations.MARK_COLUMN, True) |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2077 |
pkg_stem = model.get_value(itr, enumerations.STEM_COLUMN) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2078 |
pkg_status = model.get_value(itr, enumerations.STATUS_COLUMN) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2079 |
self.__add_pkg_stem_to_list(pkg_stem, pkg_status) |
483 | 2080 |
self.__enable_disable_selection_menus() |
2081 |
self.update_statusbar() |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2082 |
self.__enable_disable_install_remove() |
483 | 2083 |
|
2084 |
def __on_deselect(self, widget): |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2085 |
focus_widget = self.w_main_window.get_focus() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2086 |
if self.__is_a_textview(focus_widget): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2087 |
focus_widget.emit('select-all', False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2088 |
self.w_deselect_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2089 |
self.w_selectall_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2090 |
return |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2091 |
elif focus_widget == self.w_searchentry: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2092 |
focus_widget.select_region(0, 0) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2093 |
self.w_deselect_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2094 |
self.w_selectall_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2095 |
return |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2096 |
|
483 | 2097 |
sort_filt_model = \ |
2098 |
self.w_application_treeview.get_model() #gtk.TreeModelSort |
|
2099 |
filt_model = sort_filt_model.get_model() #gtk.TreeModelFilter |
|
2100 |
model = filt_model.get_model() #gtk.ListStore |
|
2101 |
iter_next = sort_filt_model.get_iter_first() |
|
2102 |
list_of_paths = [] |
|
2103 |
while iter_next != None: |
|
2104 |
sorted_path = sort_filt_model.get_path(iter_next) |
|
2105 |
filtered_iter = sort_filt_model.convert_iter_to_child_iter(None, \ |
|
2106 |
iter_next) |
|
2107 |
app_iter = filt_model.convert_iter_to_child_iter(filtered_iter) |
|
2108 |
filtered_path = \ |
|
2109 |
sort_filt_model.convert_path_to_child_path(sorted_path) |
|
2110 |
path = filt_model.convert_path_to_child_path(filtered_path) |
|
2111 |
if model.get_value(app_iter, enumerations.MARK_COLUMN): |
|
2112 |
list_of_paths.append(path) |
|
2113 |
iter_next = sort_filt_model.iter_next(iter_next) |
|
2114 |
for path in list_of_paths: |
|
2115 |
itr = model.get_iter(path) |
|
929
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2116 |
already_deselected = not model.get_value(itr, |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2117 |
enumerations.MARK_COLUMN) |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2118 |
if not already_deselected: |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2119 |
model.set_value(itr, enumerations.MARK_COLUMN, False) |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2120 |
self.__remove_pkg_stem_from_list(model.get_value(itr, |
66da4e8c37b4
6989 Remove button enabled unexpectedly
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
927
diff
changeset
|
2121 |
enumerations.STEM_COLUMN)) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2122 |
self.w_selectall_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2123 |
self.w_deselect_menuitem.set_sensitive(False) |
483 | 2124 |
self.__enable_disable_selection_menus() |
2125 |
self.update_statusbar() |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2126 |
self.__enable_disable_install_remove() |
483 | 2127 |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2128 |
def __on_preferences(self, widget): |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2129 |
self.w_startpage_checkbutton.set_active(self.show_startpage) |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2130 |
self.w_preferencesdialog.show() |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2131 |
|
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2132 |
def __on_preferencesclose_clicked(self, widget): |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2133 |
self.w_preferencesdialog.hide() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2134 |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2135 |
def __on_preferenceshelp_clicked(self, widget): |
985
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
2136 |
gui_misc.display_help(self.application_dir, "pm_win") |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2137 |
|
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2138 |
def __on_startpage_checkbutton_toggled(self, widget): |
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2139 |
self.show_startpage = self.w_startpage_checkbutton.get_active() |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2140 |
try: |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2141 |
self.client.set_bool(SHOW_STARTPAGE_PREFERENCES, |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2142 |
self.show_startpage) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2143 |
except GError: |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2144 |
pass |
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2145 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2146 |
def __on_api_search_checkbox_toggled(self, widget): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2147 |
active = self.api_search_checkbox.get_active() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2148 |
if len(self.current_repos_with_search_errors) > 0: |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
2149 |
if active: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2150 |
for pub, err_type, err_str in \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2151 |
self.current_repos_with_search_errors: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2152 |
if pub not in self.gconf_not_show_repos: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2153 |
self.gconf_not_show_repos += pub + "," |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2154 |
self.pylintstub = err_type |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2155 |
self.pylintstub = err_str |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
2156 |
else: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2157 |
for pub, err_type, err_str in \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2158 |
self.current_repos_with_search_errors: |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
2159 |
self.gconf_not_show_repos = \ |
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
2160 |
self.gconf_not_show_repos.replace( |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2161 |
pub + ",", "") |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2162 |
try: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2163 |
self.client.set_string(API_SEARCH_ERROR_PREFERENCES, |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2164 |
self.gconf_not_show_repos) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2165 |
except GError: |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2166 |
pass |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
2167 |
|
483 | 2168 |
def __on_searchentry_focus_in(self, widget, event): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2169 |
if self.w_main_clipboard.wait_is_text_available(): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2170 |
self.w_paste_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2171 |
char_count = widget.get_text_length() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2172 |
if char_count > 0: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2173 |
self.w_selectall_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2174 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2175 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2176 |
bounds = widget.get_selection_bounds() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2177 |
if bounds: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2178 |
offset1 = bounds[0] |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2179 |
offset2 = bounds[1] |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2180 |
if abs(offset2 - offset1) == char_count: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2181 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2182 |
self.w_deselect_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2183 |
self.w_copy_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2184 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2185 |
self.w_deselect_menuitem.set_sensitive(False) |
483 | 2186 |
|
2187 |
def __on_searchentry_focus_out(self, widget, event): |
|
2188 |
self.w_paste_menuitem.set_sensitive(False) |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2189 |
self.__enable_disable_select_all() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2190 |
self.__enable_disable_deselect() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2191 |
self.w_cut_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2192 |
self.w_copy_menuitem.set_sensitive(False) |
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
2193 |
self.w_delete_menuitem.set_sensitive(False) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2194 |
return False |
483 | 2195 |
|
1135
ecf0a27789e3
8824 Package Manager search doesn't behave properly with IIIM
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1123
diff
changeset
|
2196 |
def __on_searchentry_activate(self, widget): |
ecf0a27789e3
8824 Package Manager search doesn't behave properly with IIIM
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1123
diff
changeset
|
2197 |
self.__do_search() |
872
6e436e167ae4
6354 Add Preferences Dialog to PM
John Rice <john.rice@sun.com>
parents:
871
diff
changeset
|
2198 |
|
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2199 |
def __on_searchentry_selection(self, widget, pspec): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2200 |
self.__enable_disable_entry_selection(widget) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2201 |
|
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2202 |
def __enable_disable_entry_selection(self, widget): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2203 |
char_count = widget.get_text_length() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2204 |
bounds = widget.get_selection_bounds() |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2205 |
if bounds: |
483 | 2206 |
#enable selection functions |
2207 |
self.w_cut_menuitem.set_sensitive(True) |
|
2208 |
self.w_copy_menuitem.set_sensitive(True) |
|
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
2209 |
self.w_delete_menuitem.set_sensitive(True) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2210 |
if char_count == abs(bounds[1] - bounds[0]): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2211 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2212 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2213 |
self.w_selectall_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2214 |
self.w_deselect_menuitem.set_sensitive(True) |
483 | 2215 |
else: |
2216 |
self.w_cut_menuitem.set_sensitive(False) |
|
2217 |
self.w_copy_menuitem.set_sensitive(False) |
|
1202
e4fbdfd3714e
8821 The behavior of Clear menu item is incorrect
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1191
diff
changeset
|
2218 |
self.w_delete_menuitem.set_sensitive(False) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2219 |
self.w_deselect_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2220 |
if char_count == 0: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2221 |
self.w_selectall_menuitem.set_sensitive(False) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2222 |
else: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2223 |
self.w_selectall_menuitem.set_sensitive(True) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2224 |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2225 |
def __refilter_on_idle(self): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2226 |
if self.application_refilter_id != 0: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2227 |
gobject.source_remove(self.application_refilter_id) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2228 |
self.application_refilter_id = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2229 |
if self.application_refilter_idle_id == 0: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2230 |
self.application_refilter_idle_id = gobject.idle_add( |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2231 |
self.__application_refilter) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2232 |
|
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
2233 |
def __on_category_focus_in(self, widget, event, user): |
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
2234 |
self.__on_category_row_activated(None, None, None, user) |
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
2235 |
|
866 | 2236 |
def __on_category_row_activated(self, view, path, col, user): |
2237 |
'''This function is for handling category double click activations''' |
|
1122
cf87b7d8fe39
8888 Gtk warning emitted on Reload
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1109
diff
changeset
|
2238 |
if self.w_filter_combobox.get_model(): |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2239 |
self.w_filter_combobox.set_active( |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2240 |
self.saved_filter_combobox_active) |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
2241 |
self.w_searchentry.delete_text(0, -1) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2242 |
if self.in_search_mode or self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2243 |
self.__unset_search(True) |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
2244 |
if self.selected == 0: |
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
2245 |
gobject.idle_add(self.__enable_disable_install_remove) |
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
2246 |
return |
866 | 2247 |
self.__set_main_view_package_list() |
2248 |
self.set_busy_cursor() |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2249 |
self.__refilter_on_idle() |
866 | 2250 |
if self.selected == 0: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2251 |
gobject.idle_add(self.__enable_disable_install_remove) |
866 | 2252 |
|
2253 |
def __set_main_view_package_list(self): |
|
2254 |
# Only switch from Start Page View to List view if we are not in startup |
|
2255 |
if not self.in_startpage_startup: |
|
2256 |
self.w_main_view_notebook.set_current_page( |
|
2257 |
NOTEBOOK_PACKAGE_LIST_PAGE) |
|
2258 |
||
483 | 2259 |
def __on_category_selection_changed(self, selection, widget): |
2260 |
'''This function is for handling category selection changes''' |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2261 |
if self.in_setup or self.changing_search_option: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2262 |
return |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2263 |
model, itr = selection.get_selected() |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2264 |
if itr: |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2265 |
cat_path = model.get_string_from_iter(itr) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2266 |
if self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2267 |
selected_section = self.set_section |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2268 |
else: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2269 |
selected_section = self.w_sections_combobox.get_active() |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2270 |
section_row = self.section_list[selected_section] |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2271 |
section_row[enumerations.SECTION_SUBCATEGORY] = cat_path |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2272 |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2273 |
if self.in_search_mode or self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2274 |
return |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2275 |
|
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2276 |
if self.saved_filter_combobox_active != None: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2277 |
self.w_filter_combobox.set_active( |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2278 |
self.saved_filter_combobox_active) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2279 |
self.__set_main_view_package_list() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2280 |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2281 |
self.set_busy_cursor() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2282 |
self.__refilter_on_idle() |
816
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2283 |
if self.selected == 0: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2284 |
gobject.idle_add(self.__enable_disable_install_remove) |
483 | 2285 |
|
861
2a5fb898a335
4578 IPS GUI does not update the package info after upgrading
Padraig O'Briain <padraig.obriain@sun.com>
parents:
844
diff
changeset
|
2286 |
def __process_package_selection(self): |
2a5fb898a335
4578 IPS GUI does not update the package info after upgrading
Padraig O'Briain <padraig.obriain@sun.com>
parents:
844
diff
changeset
|
2287 |
model, itr = self.package_selection.get_selected() |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2288 |
if self.show_info_id != 0: |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2289 |
gobject.source_remove(self.show_info_id) |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2290 |
self.show_info_id = 0 |
483 | 2291 |
if itr: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2292 |
self.__enable_disable_install_remove() |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2293 |
self.selected_pkgstem = \ |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2294 |
model.get_value(itr, enumerations.STEM_COLUMN) |
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
2295 |
pkg = model.get_value(itr, enumerations.FMRI_COLUMN) |
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
2296 |
gobject.idle_add(self.__show_fetching_package_info, pkg) |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2297 |
self.showing_empty_details = False |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2298 |
self.last_show_info_id = self.show_info_id = \ |
1183
05f2a75fdcdf
9558 Support for typeahead search in Package Manager should be removed
John Rice <john.rice@sun.com>
parents:
1179
diff
changeset
|
2299 |
gobject.timeout_add(SHOW_INFO_DELAY, |
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
2300 |
self.__show_info, model, model.get_path(itr)) |
1049
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
2301 |
if (self.w_info_notebook.get_current_page() == |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
2302 |
INFO_NOTEBOOK_LICENSE_PAGE): |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
2303 |
self.__on_notebook_change(None, None, |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
2304 |
INFO_NOTEBOOK_LICENSE_PAGE) |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2305 |
else: |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2306 |
self.selected_model = None |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2307 |
self.selected_path = None |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2308 |
self.selected_pkgstem = None |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2309 |
|
861
2a5fb898a335
4578 IPS GUI does not update the package info after upgrading
Padraig O'Briain <padraig.obriain@sun.com>
parents:
844
diff
changeset
|
2310 |
def __on_package_selection_changed(self, selection, widget): |
2a5fb898a335
4578 IPS GUI does not update the package info after upgrading
Padraig O'Briain <padraig.obriain@sun.com>
parents:
844
diff
changeset
|
2311 |
'''This function is for handling package selection changes''' |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2312 |
if self.in_setup: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2313 |
return |
861
2a5fb898a335
4578 IPS GUI does not update the package info after upgrading
Padraig O'Briain <padraig.obriain@sun.com>
parents:
844
diff
changeset
|
2314 |
self.__process_package_selection() |
483 | 2315 |
|
2316 |
def __on_filtercombobox_changed(self, widget): |
|
2317 |
'''On filter combobox changed''' |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2318 |
if self.in_setup or self.changing_search_option: |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2319 |
return |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
2320 |
active = self.w_filter_combobox.get_active() |
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
2321 |
if active != enumerations.FILTER_SELECTED: |
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
2322 |
self.saved_filter_combobox_active = active |
866 | 2323 |
self.__set_main_view_package_list() |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2324 |
self.set_busy_cursor() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2325 |
self.__refilter_on_idle() |
816
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2326 |
if self.selected == 0: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2327 |
gobject.idle_add(self.__enable_disable_install_remove) |
483 | 2328 |
|
821
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
2329 |
def __set_categories_visibility(self, selected_section): |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2330 |
self.category_list[0][enumerations.CATEGORY_ICON] = None |
483 | 2331 |
if selected_section == 0: |
2332 |
for category in self.category_list: |
|
2333 |
category[enumerations.CATEGORY_VISIBLE] = True |
|
2334 |
else: |
|
2335 |
for category in self.category_list: |
|
2336 |
if category[enumerations.CATEGORY_ID] == 0: |
|
2337 |
category[enumerations.CATEGORY_VISIBLE] = True |
|
2338 |
else: |
|
2339 |
category_list = \ |
|
2340 |
category[enumerations.SECTION_LIST_OBJECT] |
|
2341 |
if not category_list: |
|
2342 |
category[enumerations.CATEGORY_VISIBLE] \ |
|
2343 |
= False |
|
2344 |
else: |
|
2345 |
for section in category_list: |
|
2346 |
if section == selected_section: |
|
2347 |
category[enumerations. \ |
|
2348 |
CATEGORY_VISIBLE] = \ |
|
2349 |
True |
|
2350 |
else: |
|
2351 |
category[enumerations. \ |
|
2352 |
CATEGORY_VISIBLE] = \ |
|
2353 |
False |
|
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2354 |
|
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2355 |
# Set category icon for All if a visible category has it |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2356 |
for category in self.category_list: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2357 |
if category[enumerations.CATEGORY_ICON] != None: |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2358 |
self.category_list[0][enumerations.CATEGORY_ICON] = \ |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2359 |
category[enumerations.CATEGORY_ICON] |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2360 |
break |
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2361 |
|
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2362 |
section_row = self.section_list[selected_section] |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2363 |
cat_path = section_row[enumerations.SECTION_SUBCATEGORY] |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2364 |
if cat_path != None: |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2365 |
itr = self.category_list_filter.get_iter_from_string(cat_path) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2366 |
path = self.category_list_filter.get_path(itr) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2367 |
self.w_categories_treeview.set_cursor(path, |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2368 |
None, start_editing=False) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
2369 |
|
821
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
2370 |
def __on_sectionscombobox_changed(self, widget): |
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
2371 |
'''On section combobox changed''' |
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
2372 |
if self.in_setup: |
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
2373 |
return |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2374 |
if self.changing_search_option: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2375 |
return |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2376 |
self.__set_main_view_package_list() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2377 |
self.set_busy_cursor() |
892 | 2378 |
self.__set_first_category_text() |
821
c86df5cfbe44
5738 Need mechanism to change initial value for TopLevel and category
Padraig O'Briain <padraig.obriain@sun.com>
parents:
816
diff
changeset
|
2379 |
self.__set_categories_visibility(widget.get_active()) |
483 | 2380 |
self.category_list_filter.refilter() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2381 |
if self.in_search_mode or self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2382 |
self.saved_sections_combobox_active = \ |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2383 |
self.w_sections_combobox.get_active() |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2384 |
self.__unset_search(True) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2385 |
return |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2386 |
self.__refilter_on_idle() |
816
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2387 |
if self.selected == 0: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2388 |
gobject.idle_add(self.__enable_disable_install_remove) |
483 | 2389 |
|
892 | 2390 |
def __set_first_category_text(self): |
2391 |
active_section = self.w_sections_combobox.get_active() |
|
2392 |
all_cat_text = _("All") |
|
2393 |
if active_section != 0: |
|
2394 |
all_cat_text += " " + self.section_list[active_section][1] |
|
2395 |
category_model = self.w_categories_treeview.get_model() |
|
2396 |
if category_model: |
|
2397 |
list_store = category_model.get_model() |
|
2398 |
list_store[0][1] = all_cat_text |
|
2399 |
||
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2400 |
def __unset_search(self, same_repo): |
963
43c2dd2d4943
7563 Remote search error rework
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
962
diff
changeset
|
2401 |
self.w_infosearch_frame.hide() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2402 |
self.changing_search_option = True |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2403 |
self.current_search_option = 0 |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2404 |
selected_publisher = self.__get_selected_publisher() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2405 |
if selected_publisher in self.selected_pkgs: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2406 |
self.selected_pkgs.pop(selected_publisher) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2407 |
if selected_publisher in self.to_install_update: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2408 |
self.to_install_update.pop(selected_publisher) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2409 |
if selected_publisher in self.to_remove: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2410 |
self.to_remove.pop(selected_publisher) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2411 |
self.__update_tooltips() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2412 |
if self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2413 |
self.__update_repository_combobox_for_search(False) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2414 |
pixbuf = self.search_options[0][1] |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2415 |
self.search_image.set_from_pixbuf(pixbuf) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2416 |
self.in_search_mode = False |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2417 |
self.is_search_all = False |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2418 |
if same_repo: |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2419 |
self.__restore_setup_for_browse() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2420 |
self.changing_search_option = False |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2421 |
|
483 | 2422 |
def __on_repositorycombobox_changed(self, widget): |
2423 |
'''On repository combobox changed''' |
|
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2424 |
if self.changing_search_option: |
896
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
2425 |
return |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2426 |
self.changing_search_option = True |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2427 |
selected_publisher = self.__get_selected_publisher() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2428 |
if self.is_search_all: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2429 |
same_repo = False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2430 |
index = self.w_repository_combobox.get_active() - 1 |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2431 |
if index == -1: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2432 |
# We get here is we choose "Add ..." when |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2433 |
# doing api search |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2434 |
self.changing_search_option = False |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2435 |
return |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2436 |
if not selected_publisher == _("Add..."): |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2437 |
if self.saved_repository_combobox_active == index: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2438 |
same_repo = True |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2439 |
self.__unset_search(same_repo) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2440 |
self.w_repository_combobox.set_active(index) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2441 |
if same_repo: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2442 |
self.changing_search_option = False |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2443 |
return |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2444 |
selected_publisher = self.__get_selected_publisher() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2445 |
self.changing_search_option = False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2446 |
if selected_publisher == self.last_visible_publisher: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2447 |
# If we are coming back to the same repository, we do |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2448 |
# not want to setup publishers. This is the case when |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2449 |
# we are calling Add... then we are firing the event for |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2450 |
# Add... case and immediately coming back to the |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2451 |
# previously selected repository. |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2452 |
return |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2453 |
# Checking for Add... is fine enough, as the repository |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2454 |
# name cannot contain "..." in the name. |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2455 |
if selected_publisher == _("Add..."): |
896
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
2456 |
index = -1 |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2457 |
if self.is_search_all: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2458 |
index = 0 |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2459 |
else: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2460 |
model = self.w_repository_combobox.get_model() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2461 |
for entry in model: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2462 |
if entry[1] == self.last_visible_publisher: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2463 |
index = entry[0] |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2464 |
break |
896
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
2465 |
# We do not want to switch permanently to the Add... |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2466 |
self.w_repository_combobox.set_active(index) |
896
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
2467 |
self.__on_edit_repositories_activate(None) |
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
2468 |
return |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2469 |
self.cancelled = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2470 |
self.in_setup = True |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2471 |
self.set_busy_cursor() |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2472 |
self.__set_empty_details_panel() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2473 |
if self.in_search_mode: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2474 |
self.__unset_search(False) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2475 |
|
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2476 |
pub = [selected_publisher, ] |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2477 |
self.set_show_filter = self.initial_show_filter |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2478 |
self.set_section = self.initial_section |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2479 |
Thread(target = self.__setup_publisher, args = [pub]).start() |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2480 |
self.__set_main_view_package_list() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2481 |
|
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2482 |
def __get_selected_publisher(self): |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2483 |
pub_iter = self.w_repository_combobox.get_active_iter() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2484 |
if pub_iter == None: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2485 |
return None |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2486 |
return self.repositories_list.get_value(pub_iter, \ |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2487 |
enumerations.REPOSITORY_NAME) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2488 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2489 |
def __setup_publisher(self, publishers): |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
2490 |
self.saved_filter_combobox_active = self.initial_show_filter |
892 | 2491 |
application_list, category_list , section_list = \ |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2492 |
self.__get_application_categories_lists(publishers) |
1203
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2493 |
self.__unset_saved() |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2494 |
self.publisher_changed = True |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2495 |
self.last_visible_publisher = self.__get_selected_publisher() |
892 | 2496 |
gobject.idle_add(self.__init_tree_views, application_list, |
2497 |
category_list, section_list) |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2498 |
|
1203
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2499 |
def __unset_saved(self): |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2500 |
self.saved_application_list = None |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2501 |
self.saved_application_list_filter = None |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2502 |
self.saved_application_list_sort = None |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2503 |
self.saved_category_list = None |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2504 |
self.saved_section_list = None |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2505 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2506 |
def __get_application_categories_lists(self, publishers): |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2507 |
application_list = self.__get_new_application_liststore() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2508 |
category_list = self.__get_new_category_liststore() |
892 | 2509 |
section_list = self.__get_new_section_liststore() |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2510 |
first_loop = True |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2511 |
for pub in publishers: |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2512 |
uptodate = False |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2513 |
try: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2514 |
uptodate = self.__check_if_cache_uptodate(pub) |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2515 |
if uptodate: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2516 |
self.__add_pkgs_to_lists_from_cache(pub, |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2517 |
application_list, category_list, |
892 | 2518 |
section_list) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
2519 |
except (UnpicklingError, EOFError, IOError): |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2520 |
#Most likely cache is corrupted, silently load list |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2521 |
#from api. |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2522 |
application_list = self.__get_new_application_liststore() |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2523 |
category_list = self.__get_new_category_liststore() |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2524 |
uptodate = False |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2525 |
if not uptodate: |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2526 |
if first_loop == True: |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2527 |
first_loop = False |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2528 |
gobject.idle_add(self.setup_progressdialog_show) |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2529 |
self.api_o.refresh(pubs=[pub]) |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2530 |
self.__add_pkgs_to_lists_from_api(pub, |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2531 |
application_list, category_list, section_list) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2532 |
category_list.prepend([0, _('All'), None, None, False, |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2533 |
True, None]) |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2534 |
if self.application_list and self.category_list and \ |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2535 |
not self.last_visible_publisher_uptodate: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2536 |
if self.last_visible_publisher: |
1203
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2537 |
dump_list = self.application_list |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2538 |
if self.saved_application_list != None: |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2539 |
dump_list = \ |
d146c4940f88
9815 Wrong cache generated while doing single repo search.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1202
diff
changeset
|
2540 |
self.saved_application_list |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2541 |
self.__dump_datamodels( |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2542 |
self.last_visible_publisher, dump_list, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2543 |
self.category_list, self.section_list) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2544 |
self.last_visible_publisher_uptodate = uptodate |
892 | 2545 |
return application_list, category_list, section_list |
483 | 2546 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2547 |
def __check_if_cache_uptodate(self, pub): |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2548 |
if self.cache_o: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2549 |
return self.cache_o.check_if_cache_uptodate(pub) |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2550 |
return False |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2551 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2552 |
def __dump_datamodels(self, pub, application_list, category_list, |
892 | 2553 |
section_list): |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2554 |
#Consistency check - only dump models if publisher passed in matches |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2555 |
#publisher in application list |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2556 |
if application_list == None: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2557 |
return |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2558 |
try: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2559 |
app_pub = self.application_list[0]\ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2560 |
[enumerations.AUTHORITY_COLUMN] |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2561 |
except (IndexError, ValueError): |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2562 |
#Empty application list nothing to dump |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2563 |
return |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2564 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2565 |
if pub != app_pub: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2566 |
if debug: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2567 |
print "ERROR: __dump_data_models(): INCONSISTENT " \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2568 |
"pub %s != app_list_pub %s" % \ |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2569 |
(pub, app_pub) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2570 |
return |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2571 |
|
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2572 |
if self.cache_o: |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2573 |
if self.img_timestamp == \ |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2574 |
self.cache_o.get_index_timestamp(): |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2575 |
Thread(target = self.cache_o.dump_datamodels, |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2576 |
args = (pub, application_list, category_list, |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2577 |
section_list)).start() |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2578 |
else: |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2579 |
self.__remove_cache() |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2580 |
|
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2581 |
def __remove_cache(self): |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2582 |
model = self.w_repository_combobox.get_model() |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2583 |
for pub in model: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2584 |
pub_name = pub[1] |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2585 |
if pub_name and pub_name != _("Add..."): |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2586 |
Thread(target = self.cache_o.remove_datamodel, |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2587 |
args = [pub[1]]).start() |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
2588 |
|
483 | 2589 |
def __on_install_update(self, widget): |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2590 |
self.api_o.reset() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2591 |
install_update = [] |
816
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2592 |
if self.selected == 0: |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2593 |
model, itr = self.package_selection.get_selected() |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2594 |
if itr: |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2595 |
install_update.append( |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2596 |
model.get_value(itr, enumerations.STEM_COLUMN)) |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2597 |
else: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2598 |
visible_publisher = self.__get_selected_publisher() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2599 |
pkgs = self.selected_pkgs.get(visible_publisher) |
914
6eb7fdf5b986
7031 Install/Update and Remove buttons should act only on visible repository.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
912
diff
changeset
|
2600 |
if pkgs: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2601 |
for pkg_stem in pkgs: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2602 |
status = pkgs.get(pkg_stem) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2603 |
if status == enumerations.NOT_INSTALLED or \ |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2604 |
status == enumerations.UPDATABLE: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2605 |
install_update.append(pkg_stem) |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2606 |
|
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2607 |
if self.img_timestamp != self.cache_o.get_index_timestamp(): |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2608 |
self.img_timestamp = None |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2609 |
self.__remove_cache() |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2610 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2611 |
installupdate.InstallUpdate(install_update, self, \ |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2612 |
self.api_o, ips_update = False, \ |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2613 |
action = enumerations.INSTALL_UPDATE) |
483 | 2614 |
|
2615 |
def __on_update_all(self, widget): |
|
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2616 |
self.api_o.reset() |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2617 |
installupdate.InstallUpdate([], self, |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2618 |
self.api_o, ips_update = False, |
869
0197953cd88a
5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents:
868
diff
changeset
|
2619 |
action = enumerations.IMAGE_UPDATE, be_name = self.ua_be_name, |
0197953cd88a
5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents:
868
diff
changeset
|
2620 |
parent_name = _("Package Manager"), |
0197953cd88a
5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents:
868
diff
changeset
|
2621 |
pkg_list = ["SUNWipkg", "SUNWipkg-gui"], |
0197953cd88a
5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents:
868
diff
changeset
|
2622 |
main_window = self.w_main_window) |
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2623 |
return |
483 | 2624 |
|
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
2625 |
def __on_ua_completed_linkbutton_clicked(self, widget): |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
2626 |
try: |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
2627 |
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:
1014
diff
changeset
|
2628 |
except gobject.GError: |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
2629 |
self.error_occurred(_("Unable to navigate to:\n\t%s") % |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
2630 |
self.release_notes_url) |
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
2631 |
|
483 | 2632 |
def __on_help_about(self, widget): |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2633 |
wTreePlan = gtk.glade.XML(self.gladefile, "aboutdialog") |
483 | 2634 |
aboutdialog = wTreePlan.get_widget("aboutdialog") |
2635 |
aboutdialog.connect("response", lambda x = None, \ |
|
2636 |
y = None: aboutdialog.destroy()) |
|
2637 |
aboutdialog.run() |
|
2638 |
||
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2639 |
def __on_help_help(self, widget): |
942
cb2774668721
6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents:
941
diff
changeset
|
2640 |
gui_misc.display_help(self.application_dir) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2641 |
|
483 | 2642 |
def __on_remove(self, widget): |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2643 |
self.api_o.reset() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2644 |
remove_list = [] |
816
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2645 |
if self.selected == 0: |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2646 |
model, itr = self.package_selection.get_selected() |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2647 |
if itr: |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2648 |
remove_list.append( |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2649 |
model.get_value(itr, enumerations.STEM_COLUMN)) |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
2650 |
else: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2651 |
visible_publisher = self.__get_selected_publisher() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2652 |
pkgs = self.selected_pkgs.get(visible_publisher) |
914
6eb7fdf5b986
7031 Install/Update and Remove buttons should act only on visible repository.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
912
diff
changeset
|
2653 |
if pkgs: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2654 |
for pkg_stem in pkgs: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2655 |
status = pkgs.get(pkg_stem) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2656 |
if status == enumerations.INSTALLED or \ |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2657 |
status == enumerations.UPDATABLE: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2658 |
remove_list.append(pkg_stem) |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2659 |
|
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2660 |
if self.img_timestamp != self.cache_o.get_index_timestamp(): |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2661 |
self.img_timestamp = None |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2662 |
self.__remove_cache() |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2663 |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2664 |
installupdate.InstallUpdate(remove_list, self, |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2665 |
self.api_o, ips_update = False, |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2666 |
action = enumerations.REMOVE) |
483 | 2667 |
|
2668 |
def __on_reload(self, widget): |
|
2669 |
if self.description_thread_running: |
|
2670 |
self.cancelled = True |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2671 |
if self.in_search_mode or self.is_search_all: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
2672 |
self.__unset_search(False) |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
2673 |
self.__set_empty_details_panel() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2674 |
self.in_setup = True |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2675 |
self.last_visible_publisher = None |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2676 |
if widget != None: |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
2677 |
self.__remove_cache() |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2678 |
self.w_progress_dialog.set_title(_("Refreshing catalogs")) |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2679 |
self.w_progressinfo_label.set_text(_("Refreshing catalogs...")) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2680 |
self.progress_stop_timer_thread = False |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2681 |
Thread(target = self.__progressdialog_progress_pulse).start() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2682 |
self.w_progress_dialog.show() |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
2683 |
self.w_progress_cancel.hide() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2684 |
self.__disconnect_models() |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
2685 |
self.in_reload = True |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2686 |
Thread(target = self.__catalog_refresh).start() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2687 |
|
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2688 |
def __catalog_refresh_done(self): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2689 |
self.progress_stop_timer_thread = True |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2690 |
#Let the progress_pulse finish. This should be done other way, but at |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2691 |
#The moment this works fine |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2692 |
time.sleep(0.2) |
947
181d3c7a54ee
6635 Need support Search across All Repositories (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
944
diff
changeset
|
2693 |
gobject.idle_add(self.w_progress_cancel.show) |
898
f5eab9e6f812
6747 packagemanager hangs on Reload if orca is running
Padraig O'Briain <padraig.obriain@sun.com>
parents:
897
diff
changeset
|
2694 |
gobject.idle_add(self.process_package_list_start, |
f5eab9e6f812
6747 packagemanager hangs on Reload if orca is running
Padraig O'Briain <padraig.obriain@sun.com>
parents:
897
diff
changeset
|
2695 |
self.image_directory) |
483 | 2696 |
|
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2697 |
def __main_application_quit(self, be_name = None): |
483 | 2698 |
'''quits the main gtk loop''' |
2699 |
self.cancelled = True |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
2700 |
if self.in_setup: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
2701 |
return |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2702 |
|
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2703 |
if be_name: |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2704 |
if self.image_dir_arg: |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2705 |
gobject.spawn_async([self.application_path, "-R", |
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2706 |
self.image_dir_arg, "-U", be_name]) |
483 | 2707 |
else: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2708 |
gobject.spawn_async([self.application_path, |
864
590c24c40a56
6202 All category does not report updates available.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
863
diff
changeset
|
2709 |
"-U", be_name]) |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2710 |
elif self.in_search_mode: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2711 |
self.__dump_datamodels(self.__get_selected_publisher(), |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2712 |
self.saved_application_list, self.category_list, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2713 |
self.section_list) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2714 |
else: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
2715 |
self.__dump_datamodels(self.__get_selected_publisher(), |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2716 |
self.application_list, self.category_list, |
892 | 2717 |
self.section_list) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2718 |
|
985
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
2719 |
width, height = self.w_main_window.get_size() |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
2720 |
hpos = self.w_main_hpaned.get_position() |
bcc30bb98888
5432 Package Manager does not keep window settings
John Rice <john.rice@sun.com>
parents:
968
diff
changeset
|
2721 |
vpos = self.w_main_vpaned.get_position() |
1006
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2722 |
try: |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2723 |
self.client.set_int(INITIAL_APP_WIDTH_PREFERENCES, width) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2724 |
self.client.set_int(INITIAL_APP_HEIGHT_PREFERENCES, height) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2725 |
self.client.set_int(INITIAL_APP_HPOS_PREFERENCES, hpos) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2726 |
self.client.set_int(INITIAL_APP_VPOS_PREFERENCES, vpos) |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2727 |
except GError: |
2b6ae834c4b2
7921 PM should handle gconf lookup failures gracefully
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1005
diff
changeset
|
2728 |
pass |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2729 |
|
796
bcd90655ad83
4019 Package Manager close bug
Padraig O'Briain <padraig.obriain@sun.com>
parents:
795
diff
changeset
|
2730 |
self.w_main_window.hide() |
892 | 2731 |
while gtk.events_pending(): |
2732 |
gtk.main_iteration(False) |
|
483 | 2733 |
gtk.main_quit() |
2734 |
sys.exit(0) |
|
2735 |
return True |
|
2736 |
||
2737 |
def __check_if_something_was_changed(self): |
|
2738 |
''' Returns True if any of the check boxes for package was changed, false |
|
2739 |
if not''' |
|
1139
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
2740 |
if self.application_list: |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
2741 |
for pkg in self.application_list: |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
2742 |
if pkg[enumerations.MARK_COLUMN] == True: |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
2743 |
return True |
483 | 2744 |
return False |
2745 |
||
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2746 |
def __setup_repositories_combobox(self, api_o, repositories_list): |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2747 |
self.__disconnect_repository_model() |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2748 |
default_pub = api_o.get_preferred_publisher().prefix |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2749 |
if self.default_publisher != default_pub: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2750 |
self.__clear_pkg_selections() |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2751 |
self.default_publisher = default_pub |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2752 |
selected_repos = [] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2753 |
enabled_repos = [] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2754 |
for repo in self.selected_pkgs: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2755 |
selected_repos.append(repo) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2756 |
i = 0 |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2757 |
active = 0 |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2758 |
for pub in api_o.get_publishers(): |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2759 |
if pub.disabled: |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2760 |
continue |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2761 |
prefix = pub.prefix |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2762 |
if cmp(prefix, self.default_publisher) == 0: |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2763 |
active = i |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2764 |
repositories_list.append([i, prefix, ]) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2765 |
enabled_repos.append(prefix) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2766 |
i = i + 1 |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2767 |
repositories_list.append([-1, "", ]) |
896
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
2768 |
repositories_list.append([-1, _("Add..."), ]) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2769 |
pkgs_to_remove = [] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2770 |
for repo_name in selected_repos: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2771 |
if repo_name not in enabled_repos: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2772 |
pkg_stems = self.selected_pkgs.get(repo_name) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2773 |
for pkg_stem in pkg_stems: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2774 |
pkgs_to_remove.append(pkg_stem) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2775 |
for pkg_stem in pkgs_to_remove: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2776 |
self.__remove_pkg_stem_from_list(pkg_stem) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
2777 |
self.w_repository_combobox.set_model(repositories_list) |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2778 |
if self.default_publisher: |
483 | 2779 |
self.w_repository_combobox.set_active(active) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2780 |
else: |
483 | 2781 |
self.w_repository_combobox.set_active(0) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2782 |
|
483 | 2783 |
def __active_pane_toggle(self, cell, path, model_sort): |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2784 |
'''Toggle function for column enumerations.MARK_COLUMN''' |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2785 |
applicationModel = model_sort.get_model() |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2786 |
applicationPath = model_sort.convert_path_to_child_path(path) |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2787 |
filterModel = applicationModel.get_model() |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2788 |
child_path = applicationModel.convert_path_to_child_path(applicationPath) |
483 | 2789 |
itr = filterModel.get_iter(child_path) |
2790 |
if itr: |
|
2791 |
modified = filterModel.get_value(itr, enumerations.MARK_COLUMN) |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2792 |
filterModel.set_value(itr, enumerations.MARK_COLUMN, |
483 | 2793 |
not modified) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2794 |
pkg_status = filterModel.get_value(itr, |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2795 |
enumerations.STATUS_COLUMN) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2796 |
pkg_stem = filterModel.get_value(itr, enumerations.STEM_COLUMN) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2797 |
if modified: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2798 |
self.__remove_pkg_stem_from_list(pkg_stem) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2799 |
else: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2800 |
self.__add_pkg_stem_to_list(pkg_stem, pkg_status) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2801 |
self.update_statusbar() |
483 | 2802 |
self.__enable_disable_selection_menus() |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2803 |
|
483 | 2804 |
def __update_reload_button(self): |
2805 |
if self.user_rights: |
|
2806 |
self.w_reload_button.set_sensitive(True) |
|
2807 |
else: |
|
2808 |
self.w_reload_button.set_sensitive(False) |
|
2809 |
||
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2810 |
def __add_pkg_stem_to_list(self, stem, status): |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2811 |
pub = self.__get_selected_publisher() |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2812 |
if self.selected_pkgs.get(pub) == None: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2813 |
self.selected_pkgs[pub] = {} |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2814 |
self.selected_pkgs.get(pub)[stem] = status |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2815 |
if status == enumerations.NOT_INSTALLED or \ |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2816 |
status == enumerations.UPDATABLE: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2817 |
if self.to_install_update.get(pub) == None: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2818 |
self.to_install_update[pub] = 1 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2819 |
else: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2820 |
self.to_install_update[pub] += 1 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2821 |
if status == enumerations.UPDATABLE or status == enumerations.INSTALLED: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2822 |
if self.to_remove.get(pub) == None: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2823 |
self.to_remove[pub] = 1 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2824 |
else: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2825 |
self.to_remove[pub] += 1 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2826 |
self.__update_tooltips() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2827 |
|
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2828 |
def __update_tooltips(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2829 |
to_remove = None |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2830 |
to_install = None |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2831 |
no_iter = 0 |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2832 |
for pub in self.to_remove: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2833 |
packages = self.to_remove.get(pub) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2834 |
if packages > 0: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2835 |
if no_iter == 0: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2836 |
to_remove = _("Selected for Removal:") |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2837 |
to_remove += "\n %s: %d" % (pub, packages) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2838 |
no_iter += 1 |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2839 |
no_iter = 0 |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2840 |
for pub in self.to_install_update: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2841 |
packages = self.to_install_update.get(pub) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2842 |
if packages > 0: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2843 |
if no_iter == 0: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2844 |
to_install = _("Selected for Install/Update:") |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2845 |
to_install += "\n %s: %d" % (pub, packages) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2846 |
no_iter += 1 |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2847 |
if not to_install: |
1109
007533ebbea5
8577 IPS Localization update at 2009.06 B4
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1103
diff
changeset
|
2848 |
to_install = _("Select packages by marking the checkbox " |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2849 |
"and click to Install/Update.") |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2850 |
self.w_installupdate_button.set_tooltip(self.install_button_tooltip, |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2851 |
to_install) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2852 |
if not to_remove: |
1109
007533ebbea5
8577 IPS Localization update at 2009.06 B4
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1103
diff
changeset
|
2853 |
to_remove = _("Select packages by marking the checkbox " |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2854 |
"and click to Remove selected.") |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2855 |
self.w_remove_button.set_tooltip(self.remove_button_tooltip, to_remove) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2856 |
|
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2857 |
def __remove_pkg_stem_from_list(self, stem): |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2858 |
remove_pub = [] |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2859 |
for pub in self.selected_pkgs: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2860 |
pkgs = self.selected_pkgs.get(pub) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2861 |
status = None |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2862 |
if stem in pkgs: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2863 |
status = pkgs.pop(stem) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2864 |
if status == enumerations.NOT_INSTALLED or \ |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2865 |
status == enumerations.UPDATABLE: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2866 |
if self.to_install_update.get(pub) == None: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2867 |
self.to_install_update[pub] = 0 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2868 |
else: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2869 |
self.to_install_update[pub] -= 1 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2870 |
if status == enumerations.UPDATABLE or \ |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2871 |
status == enumerations.INSTALLED: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2872 |
if self.to_remove.get(pub) == None: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2873 |
self.to_remove[pub] = 0 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2874 |
else: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2875 |
self.to_remove[pub] -= 1 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2876 |
if len(pkgs) == 0: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2877 |
remove_pub.append(pub) |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2878 |
for pub in remove_pub: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2879 |
self.selected_pkgs.pop(pub) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2880 |
self.__update_tooltips() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2881 |
|
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2882 |
def __clear_pkg_selections(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2883 |
# We clear the selections as the preffered repository was changed |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2884 |
# and pkg stems are not valid. |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2885 |
remove_pub = [] |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2886 |
for pub in self.selected_pkgs: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
2887 |
stems = self.selected_pkgs.get(pub) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2888 |
for pkg_stem in stems: |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2889 |
remove_pub.append(pkg_stem) |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
2890 |
for pkg_stem in remove_pub: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
2891 |
self.__remove_pkg_stem_from_list(pkg_stem) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2892 |
|
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2893 |
def __set_empty_details_panel(self): |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2894 |
self.showing_empty_details = True |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2895 |
if self.show_info_id != 0: |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2896 |
gobject.source_remove(self.show_info_id) |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2897 |
self.show_info_id = 0 |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2898 |
if self.show_licenses_id != 0: |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2899 |
gobject.source_remove(self.show_licenses_id) |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2900 |
self.show_licenses_id = 0 |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2901 |
pkg_name = _("Package Name") |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2902 |
self.w_packagename_label.set_markup("<b>" + pkg_name + "</b>") |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2903 |
self.w_general_info_label.set_markup("<b>" + pkg_name + "</b>") |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2904 |
self.w_installedfiles_textview.get_buffer().set_text("") |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2905 |
self.w_dependencies_textview.get_buffer().set_text("") |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2906 |
self.w_generalinfo_textview.get_buffer().set_text("") |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2907 |
self.w_license_textview.get_buffer().set_text("") |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2908 |
return |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2909 |
|
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2910 |
def __show_fetching_package_info(self, pkg): |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2911 |
pkg_name = pkg.get_name() |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2912 |
self.w_packagename_label.set_markup("<b>" + pkg_name + "</b>") |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2913 |
self.w_general_info_label.set_markup("<b>" + pkg_name + "</b>") |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2914 |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2915 |
pkg_stem = pkg.get_pkg_stem() |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2916 |
if self.__setting_from_cache(pkg_stem): |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2917 |
return |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2918 |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2919 |
self.w_shortdescription_label.set_text( |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2920 |
_("Fetching description...")) |
483 | 2921 |
instbuffer = self.w_installedfiles_textview.get_buffer() |
2922 |
depbuffer = self.w_dependencies_textview.get_buffer() |
|
2923 |
infobuffer = self.w_generalinfo_textview.get_buffer() |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2924 |
fetching_text = _("Fetching information...") |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2925 |
instbuffer.set_text(fetching_text) |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2926 |
depbuffer.set_text(fetching_text) |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2927 |
infobuffer.set_text(fetching_text) |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2928 |
return |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2929 |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2930 |
def __setting_from_cache(self, pkg_stem): |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2931 |
if len(self.info_cache) > MAX_INFO_CACHE_LIMIT: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2932 |
self.info_cache = {} |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2933 |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2934 |
if self.info_cache.has_key(pkg_stem): |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2935 |
self.w_shortdescription_label.set_text( |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2936 |
self.info_cache[pkg_stem][0]) |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2937 |
instbuffer = self.w_installedfiles_textview.get_buffer() |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2938 |
depbuffer = self.w_dependencies_textview.get_buffer() |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2939 |
infobuffer = self.w_generalinfo_textview.get_buffer() |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2940 |
infobuffer.set_text(self.info_cache[pkg_stem][1]) |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2941 |
instbuffer.set_text(self.info_cache[pkg_stem][2]) |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2942 |
depbuffer.set_text(self.info_cache[pkg_stem][3]) |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2943 |
return True |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2944 |
else: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2945 |
return False |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
2946 |
|
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2947 |
def __update_package_info(self, pkg, local_info, remote_info, info_id): |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2948 |
if self.showing_empty_details or (info_id != |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2949 |
self.last_show_info_id): |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
2950 |
return |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2951 |
pkg_name = pkg.get_name() |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2952 |
pkg_stem = pkg.get_pkg_stem() |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2953 |
self.w_packagename_label.set_markup("<b>" + pkg_name + "</b>") |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2954 |
self.w_general_info_label.set_markup("<b>" + pkg_name + "</b>") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2955 |
installed = True |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2956 |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
2957 |
if self.__setting_from_cache(pkg_stem): |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2958 |
return |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2959 |
|
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2960 |
instbuffer = self.w_installedfiles_textview.get_buffer() |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2961 |
depbuffer = self.w_dependencies_textview.get_buffer() |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2962 |
infobuffer = self.w_generalinfo_textview.get_buffer() |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2963 |
|
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2964 |
if not local_info and not remote_info: |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2965 |
network_str = \ |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2966 |
_("\nThis might be caused by network problem " |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2967 |
"while accessing the repository.") |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2968 |
self.w_shortdescription_label.set_text( |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2969 |
_("Description not available for this package...") + |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2970 |
network_str) |
483 | 2971 |
instbuffer.set_text( \ |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2972 |
_("Files Details not available for this package...") + |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2973 |
network_str) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2974 |
depbuffer.set_text(_( |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2975 |
"Dependencies info not available for this package...") + |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2976 |
network_str) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2977 |
infobuffer.set_text( |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2978 |
_("Information not available for this package...") + |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
2979 |
network_str) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
2980 |
return |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2981 |
|
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2982 |
if not local_info: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2983 |
# Package is not installed |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2984 |
local_info = remote_info |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2985 |
installed = False |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2986 |
|
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2987 |
if not remote_info: |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2988 |
remote_info = local_info |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2989 |
installed = True |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
2990 |
|
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2991 |
description = local_info.summary |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2992 |
#XXX long term need to have something more robust here for multi byte |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
2993 |
if len(description) > MAX_DESC_LEN: |
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
2994 |
description = description[:MAX_DESC_LEN] + " ..." |
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
2995 |
self.w_shortdescription_label.set_text(description) |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2996 |
inst_str = _("Root: %s\n") % self.api_o.img.get_root() |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
2997 |
dep_str = _("Dependencies:\n") |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
2998 |
|
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
2999 |
if local_info.dependencies: |
866 | 3000 |
dep_str += ''.join( |
3001 |
["\t%s\n" % x for x in local_info.dependencies]) |
|
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3002 |
if local_info.dirs: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3003 |
inst_str += ''.join(["\t%s\n" % x for x in local_info.dirs]) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3004 |
if local_info.files: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3005 |
inst_str += ''.join(["\t%s\n" % x for x in local_info.files]) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3006 |
if local_info.hardlinks: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3007 |
inst_str += ''.join(["\t%s\n" % x for x in local_info.hardlinks]) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3008 |
if local_info.links: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3009 |
inst_str += ''.join(["\t%s\n" % x for x in local_info.links]) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3010 |
info_str = "" |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3011 |
labs = {} |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3012 |
labs["sum"] = _("Summary:\t\t") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3013 |
labs["size"] = _("Size:\t\t\t") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3014 |
labs["cat"] = _("Category:\t\t") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3015 |
labs["ins"] = _("Installed Version:\t") |
1005
739eb81725b8
7824 Menus/shortcuts don't match HIG
John Rice <john.rice@sun.com>
parents:
996
diff
changeset
|
3016 |
labs["lat"] = _("Latest Version:\t") |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3017 |
labs["pkg_date"] = _("Packaging Date:\t") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3018 |
labs["fmri"] = _("FMRI:\t\t\t") |
962
d7897f87708d
7488 Information about publisher needed in GUI
Padraig O'Briain <padraig.obriain@sun.com>
parents:
955
diff
changeset
|
3019 |
labs["repository"] = _("Repository:\t\t") |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3020 |
max_len = 0 |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3021 |
for lab in labs: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3022 |
if len(labs[lab]) > max_len: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3023 |
max_len = len(labs[lab]) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3024 |
categories = _("None") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3025 |
if local_info.category_info_list: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3026 |
verbose = len(local_info.category_info_list) > 1 |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3027 |
categories = "" |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3028 |
categories += local_info.category_info_list[0].__str__(verbose) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3029 |
if len(local_info.category_info_list) > 1: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3030 |
for ci in local_info.category_info_list[1:]: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3031 |
categories += ", " + ci.__str__(verbose) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3032 |
summary = _("None") |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3033 |
if local_info.summary: |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3034 |
summary = local_info.summary |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3035 |
info_str += " %s %s" % (labs["sum"], summary) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3036 |
info_str += "\n %s %s" % (labs["size"], |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3037 |
misc.bytes_to_str(local_info.size)) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3038 |
info_str += "\n %s %s" % (labs["cat"], categories) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3039 |
if installed: |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3040 |
info_str += "\n %s %s,%s-%s" % (labs["ins"], local_info.version, |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3041 |
local_info.build_release, local_info.branch) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3042 |
info_str += "\n %s %s,%s-%s" % (labs["lat"], remote_info.version, |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3043 |
remote_info.build_release, remote_info.branch) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3044 |
info_str += "\n %s %s" % (labs["pkg_date"], local_info.packaging_date) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3045 |
info_str += "\n %s %s" % (labs["fmri"], local_info.fmri) |
962
d7897f87708d
7488 Information about publisher needed in GUI
Padraig O'Briain <padraig.obriain@sun.com>
parents:
955
diff
changeset
|
3046 |
info_str += "\n %s %s" % (labs["repository"], local_info.publisher) |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3047 |
infobuffer.set_text(info_str) |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3048 |
instbuffer.set_text(inst_str) |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3049 |
depbuffer.set_text(dep_str) |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3050 |
self.info_cache[pkg_stem] = \ |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3051 |
(description, info_str, inst_str, dep_str) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3052 |
|
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3053 |
def __update_package_license(self, licenses, license_id): |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3054 |
if self.showing_empty_details or (license_id != |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3055 |
self.last_show_licenses_id): |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3056 |
return |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3057 |
lic = "" |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3058 |
lic_u = "" |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3059 |
if licenses == None: |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3060 |
lic_u = _("Not available") |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3061 |
else: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3062 |
for licens in licenses: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3063 |
lic += licens.get_text() |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3064 |
lic += "\n" |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3065 |
try: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3066 |
lic_u = unicode(lic, "utf-8") |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3067 |
except UnicodeDecodeError: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3068 |
lic_u += "" |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3069 |
licbuffer = self.w_license_textview.get_buffer() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3070 |
licbuffer.set_text(lic_u) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3071 |
|
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
3072 |
def __show_licenses(self): |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3073 |
self.show_licenses_id = 0 |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3074 |
if self.catalog_loaded == False: |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3075 |
return |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3076 |
Thread(target = self.__show_package_licenses, |
1049
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3077 |
args = (self.selected_pkgstem, self.last_show_licenses_id,)).start() |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3078 |
|
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3079 |
def __show_package_licenses(self, selected_pkgstem, license_id): |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3080 |
if selected_pkgstem == None: |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3081 |
gobject.idle_add(self.__update_package_license, None, |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3082 |
self.last_show_licenses_id) |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3083 |
return |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3084 |
info = None |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3085 |
try: |
1049
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3086 |
info = self.api_o.info([selected_pkgstem], |
925
089ed400edf4
6902 api.info needs a fast flag or a way to pass a set of the information required (followup2)
John Rice <john.rice@sun.com>
parents:
924
diff
changeset
|
3087 |
True, frozenset([api.PackageInfo.LICENSES])) |
1191
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
3088 |
except (api_errors.TransportError): |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3089 |
pass |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3090 |
if self.showing_empty_details or (license_id != |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3091 |
self.last_show_licenses_id): |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3092 |
return |
925
089ed400edf4
6902 api.info needs a fast flag or a way to pass a set of the information required (followup2)
John Rice <john.rice@sun.com>
parents:
924
diff
changeset
|
3093 |
if not info or (info and len(info.get(0)) == 0): |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3094 |
try: |
925
089ed400edf4
6902 api.info needs a fast flag or a way to pass a set of the information required (followup2)
John Rice <john.rice@sun.com>
parents:
924
diff
changeset
|
3095 |
# Get license from remote |
1049
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3096 |
info = self.api_o.info([selected_pkgstem], |
925
089ed400edf4
6902 api.info needs a fast flag or a way to pass a set of the information required (followup2)
John Rice <john.rice@sun.com>
parents:
924
diff
changeset
|
3097 |
False, frozenset([api.PackageInfo.LICENSES])) |
1191
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
3098 |
except (api_errors.TransportError): |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3099 |
pass |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3100 |
if self.showing_empty_details or (license_id != |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3101 |
self.last_show_licenses_id): |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3102 |
return |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3103 |
pkgs_info = None |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3104 |
package_info = None |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3105 |
no_licenses = 0 |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3106 |
if info: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3107 |
pkgs_info = info[0] |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3108 |
if pkgs_info: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3109 |
package_info = pkgs_info[0] |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3110 |
if package_info: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3111 |
no_licenses = len(package_info.licenses) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3112 |
if no_licenses == 0: |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3113 |
gobject.idle_add(self.__update_package_license, None, |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3114 |
license_id) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3115 |
return |
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
3116 |
else: |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3117 |
gobject.idle_add(self.__update_package_license, |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3118 |
package_info.licenses, license_id) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3119 |
|
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3120 |
def __get_pkg_info(self, pkg_stem, local): |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3121 |
info = None |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3122 |
try: |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3123 |
info = self.api_o.info([pkg_stem], local, |
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:
915
diff
changeset
|
3124 |
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:
915
diff
changeset
|
3125 |
frozenset([api.PackageInfo.LICENSES])) |
1191
a48bee2a4b2e
305 http_proxy value needs more checking for valid url syntax
johansen <johansen@sun.com>
parents:
1187
diff
changeset
|
3126 |
except (api_errors.TransportError): |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3127 |
return info |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3128 |
pkgs_info = None |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3129 |
package_info = None |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3130 |
if info: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3131 |
pkgs_info = info[0] |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3132 |
if pkgs_info: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3133 |
package_info = pkgs_info[0] |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3134 |
if package_info: |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3135 |
return package_info |
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3136 |
else: |
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
3137 |
return None |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3138 |
|
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
3139 |
def __show_info(self, model, path): |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3140 |
self.show_info_id = 0 |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3141 |
if self.catalog_loaded == False: |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3142 |
self.selected_model = model |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3143 |
self.selected_path = path |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3144 |
return |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3145 |
if not (model and path): |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3146 |
return |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3147 |
if self.selected_model != None: |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3148 |
if (self.selected_model != model or |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3149 |
self.selected_path != path): |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3150 |
# This can happen after catalogs are loaded in |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3151 |
# enable_disable_update_all and a different |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3152 |
# package is selected before enable_disable_update_all |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3153 |
# calls __show_info. We set these variable to None |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3154 |
# so that when __show_info is called it does nothing. |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3155 |
self.selected_model = None |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3156 |
self.selected_path = None |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3157 |
|
865
81af5326a965
6239 time.sleep() should not be called when getting package info
Padraig O'Briain <padraig.obriain@sun.com>
parents:
864
diff
changeset
|
3158 |
itr = model.get_iter(path) |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3159 |
pkg = model.get_value(itr, enumerations.FMRI_COLUMN) |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3160 |
pkg_stem = model.get_value(itr, enumerations.STEM_COLUMN) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3161 |
pkg_status = model.get_value(itr, enumerations.STATUS_COLUMN) |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3162 |
if self.info_cache.has_key(pkg_stem): |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3163 |
return |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3164 |
Thread(target = self.__show_package_info, |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3165 |
args = (pkg, pkg_stem, pkg_status, self.last_show_info_id)).start() |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3166 |
|
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3167 |
def __show_package_info(self, pkg, pkg_stem, pkg_status, info_id): |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3168 |
self.api_o.log_operation_start("info") |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3169 |
local_info = None |
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3170 |
remote_info = None |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3171 |
if not self.showing_empty_details and (info_id == |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3172 |
self.last_show_info_id) and (pkg_status == |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3173 |
enumerations.INSTALLED or pkg_status == |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3174 |
enumerations.UPDATABLE): |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3175 |
local_info = self.__get_pkg_info(pkg_stem, True) |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3176 |
if not self.showing_empty_details and (info_id == |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3177 |
self.last_show_info_id) and (pkg_status == |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3178 |
enumerations.NOT_INSTALLED or pkg_status == |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3179 |
enumerations.UPDATABLE): |
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3180 |
remote_info = self.__get_pkg_info(pkg_stem, False) |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3181 |
if not self.showing_empty_details and (info_id == |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3182 |
self.last_show_info_id): |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3183 |
gobject.idle_add(self.__update_package_info, pkg, |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3184 |
local_info, remote_info, info_id) |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3185 |
self.api_o.log_operation_end() |
815
3ffb48a98485
5665 pkg manager "general info" not nearly as good as "pkg info"
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
808
diff
changeset
|
3186 |
return |
483 | 3187 |
|
3188 |
# This function is ported from pkg.actions.generic.distinguished_name() |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3189 |
@staticmethod |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3190 |
def __locale_distinguished_name(action): |
483 | 3191 |
if action.key_attr == None: |
3192 |
return str(action) |
|
3193 |
return "%s: %s" % \ |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3194 |
(_(action.name), action.attrs.get(action.key_attr, "???")) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3195 |
|
483 | 3196 |
def __application_filter(self, model, itr): |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3197 |
'''This function is used to filter content in the main |
483 | 3198 |
application view''' |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3199 |
if self.in_setup or self.cancelled: |
483 | 3200 |
return False |
895
f5bc5c3ac784
6980 Behavior of Selected Packages filter
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
894
diff
changeset
|
3201 |
filter_id = self.w_filter_combobox.get_active() |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
3202 |
if filter_id == enumerations.FILTER_SELECTED: |
895
f5bc5c3ac784
6980 Behavior of Selected Packages filter
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
894
diff
changeset
|
3203 |
return model.get_value(itr, enumerations.MARK_COLUMN) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3204 |
# XXX Show filter, chenge text to integers |
510
35ac691b5187
3193 IPS GUI throws exceptions when installing/upgrading a package
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
500
diff
changeset
|
3205 |
selected_category = 0 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3206 |
category_selection = self.w_categories_treeview.get_selection() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3207 |
category_model, category_iter = category_selection.get_selected() |
483 | 3208 |
if category_iter: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3209 |
selected_category = category_model.get_value(category_iter, |
483 | 3210 |
enumerations.CATEGORY_ID) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3211 |
category_list = model.get_value(itr, enumerations.CATEGORY_LIST_COLUMN) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3212 |
selected_section = self.w_sections_combobox.get_active() |
483 | 3213 |
category = False |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3214 |
if selected_section == 0 and selected_category == 0: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3215 |
#For section "All" and category "All" always true |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3216 |
category = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3217 |
elif selected_category != 0: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3218 |
if category_list and selected_category in category_list: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3219 |
category = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3220 |
elif category_list: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3221 |
#The selected category is "All" so we need to check |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3222 |
#If the package belongs to one of the visible categories |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
3223 |
for visible_category in category_model: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3224 |
visible_id = visible_category[enumerations.CATEGORY_ID] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3225 |
if visible_id in category_list: |
483 | 3226 |
category = True |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3227 |
break |
483 | 3228 |
if (model.get_value(itr, enumerations.IS_VISIBLE_COLUMN) == False): |
3229 |
return False |
|
1212
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
3230 |
if self.in_search_mode: |
6fcbc6b651be
9944 PM allow filtering of Search Results
John Rice <john.rice@sun.com>
parents:
1209
diff
changeset
|
3231 |
return self.__is_package_filtered(model, itr, filter_id) |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3232 |
return (category & |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3233 |
self.__is_package_filtered(model, itr, filter_id)) |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
3234 |
|
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3235 |
@staticmethod |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3236 |
def __is_package_filtered(model, itr, filter_id): |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3237 |
'''Function for filtercombobox''' |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
3238 |
if filter_id == enumerations.FILTER_ALL: |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3239 |
return True |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3240 |
status = model.get_value(itr, enumerations.STATUS_COLUMN) |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
3241 |
if filter_id == enumerations.FILTER_INSTALLED: |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3242 |
return (status == enumerations.INSTALLED or status == \ |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3243 |
enumerations.UPDATABLE) |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
3244 |
elif filter_id == enumerations.FILTER_UPDATES: |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3245 |
return status == enumerations.UPDATABLE |
937
e421cb3097da
7290 Behavior of the search
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
929
diff
changeset
|
3246 |
elif filter_id == enumerations.FILTER_NOT_INSTALLED: |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3247 |
return status == enumerations.NOT_INSTALLED |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3248 |
|
483 | 3249 |
def __is_pkg_repository_visible(self, model, itr): |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3250 |
if len(self.repositories_list) <= 1: |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3251 |
return True |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3252 |
else: |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3253 |
visible_publisher = self.__get_selected_publisher() |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3254 |
pkg = model.get_value(itr, enumerations.FMRI_COLUMN) |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3255 |
if not pkg: |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3256 |
return False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3257 |
if cmp(pkg.get_publisher(), visible_publisher) == 0: |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3258 |
return True |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3259 |
else: |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3260 |
return False |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3261 |
|
483 | 3262 |
def __enable_disable_selection_menus(self): |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3263 |
if self.in_setup: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3264 |
return |
483 | 3265 |
self.__enable_disable_select_updates() |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3266 |
if not self.__doing_search(): |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3267 |
self.unset_busy_cursor() |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
3268 |
|
483 | 3269 |
def __enable_disable_select_all(self): |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3270 |
if self.in_setup: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3271 |
return |
483 | 3272 |
if len(self.w_application_treeview.get_model()) > 0: |
3273 |
for row in self.w_application_treeview.get_model(): |
|
3274 |
if not row[enumerations.MARK_COLUMN]: |
|
3275 |
self.w_selectall_menuitem.set_sensitive(True) |
|
3276 |
return |
|
3277 |
self.w_selectall_menuitem.set_sensitive(False) |
|
3278 |
else: |
|
3279 |
self.w_selectall_menuitem.set_sensitive(False) |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3280 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3281 |
def __enable_disable_install_remove(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3282 |
if not self.user_rights: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3283 |
self.w_installupdate_button.set_sensitive(False) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3284 |
self.w_installupdate_menuitem.set_sensitive(False) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3285 |
self.w_remove_button.set_sensitive(False) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3286 |
self.w_remove_menuitem.set_sensitive(False) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3287 |
return |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3288 |
selected_removal = self.__enable_if_selected_for_removal() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3289 |
selected_install_update = self.__enable_if_selected_for_install_update() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3290 |
if selected_removal or selected_install_update: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3291 |
return |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3292 |
remove = False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3293 |
install = False |
816
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
3294 |
if self.selected == 0: |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
3295 |
model, itr = self.package_selection.get_selected() |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
3296 |
if itr: |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
3297 |
status = \ |
5d4f7746a490
3978 Selecting package rows should check the package row as well
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
815
diff
changeset
|
3298 |
model.get_value(itr, enumerations.STATUS_COLUMN) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3299 |
if status == enumerations.NOT_INSTALLED: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3300 |
remove = False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3301 |
install = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3302 |
elif status == enumerations.UPDATABLE: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3303 |
remove = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3304 |
install = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3305 |
elif status == enumerations.INSTALLED: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3306 |
remove = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3307 |
install = False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3308 |
self.w_installupdate_button.set_sensitive(install) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3309 |
self.w_installupdate_menuitem.set_sensitive(install) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3310 |
self.w_remove_button.set_sensitive(remove) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3311 |
self.w_remove_menuitem.set_sensitive(remove) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3312 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3313 |
def __enable_if_selected_for_removal(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3314 |
sensitive = False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3315 |
visible_publisher = self.__get_selected_publisher() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3316 |
selected = self.to_remove.get(visible_publisher) |
914
6eb7fdf5b986
7031 Install/Update and Remove buttons should act only on visible repository.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
912
diff
changeset
|
3317 |
if selected > 0: |
6eb7fdf5b986
7031 Install/Update and Remove buttons should act only on visible repository.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
912
diff
changeset
|
3318 |
sensitive = True |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3319 |
self.w_remove_button.set_sensitive(sensitive) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3320 |
self.w_remove_menuitem.set_sensitive(sensitive) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3321 |
return sensitive |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3322 |
|
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3323 |
def __enable_if_selected_for_install_update(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3324 |
sensitive = False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3325 |
visible_publisher = self.__get_selected_publisher() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3326 |
selected = self.to_install_update.get(visible_publisher) |
914
6eb7fdf5b986
7031 Install/Update and Remove buttons should act only on visible repository.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
912
diff
changeset
|
3327 |
if selected > 0: |
6eb7fdf5b986
7031 Install/Update and Remove buttons should act only on visible repository.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
912
diff
changeset
|
3328 |
sensitive = True |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3329 |
self.w_installupdate_button.set_sensitive(sensitive) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3330 |
self.w_installupdate_menuitem.set_sensitive(sensitive) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3331 |
return sensitive |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3332 |
|
483 | 3333 |
def __enable_disable_select_updates(self): |
3334 |
for row in self.w_application_treeview.get_model(): |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3335 |
if row[enumerations.STATUS_COLUMN] == enumerations.UPDATABLE: |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3336 |
if not row[enumerations.MARK_COLUMN]: |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3337 |
self.w_selectupdates_menuitem. \ |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3338 |
set_sensitive(True) |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3339 |
return |
483 | 3340 |
self.w_selectupdates_menuitem.set_sensitive(False) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3341 |
return |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3342 |
|
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3343 |
def __get_inventory_list(self, pargs, all_known, all_versions): |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3344 |
self.__image_activity_lock.acquire() |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3345 |
try: |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3346 |
res = misc.get_inventory_list(self.api_o.img, |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3347 |
pargs, all_known, all_versions) |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3348 |
finally: |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3349 |
self.__image_activity_lock.release() |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3350 |
return res |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3351 |
|
483 | 3352 |
def __enable_disable_update_all(self): |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3353 |
#XXX Api to provide fast information if there are some updates |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3354 |
#available within image |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3355 |
gobject.idle_add(self.w_updateall_button.set_sensitive, False) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3356 |
gobject.idle_add(self.w_updateall_menuitem.set_sensitive, False) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3357 |
update_available = self.__check_if_updates_available() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3358 |
gobject.idle_add(self.__g_enable_disable_update_all, update_available) |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3359 |
gobject.idle_add(self.__show_info_after_catalog_load) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3360 |
return False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3361 |
|
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3362 |
def __show_info_after_catalog_load(self): |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3363 |
self.__show_info(self.selected_model, self.selected_path) |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3364 |
self.selected_model = None |
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3365 |
self.selected_path = None |
1049
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3366 |
if (self.w_info_notebook.get_current_page() == |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3367 |
INFO_NOTEBOOK_LICENSE_PAGE and |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3368 |
not self.showing_empty_details): |
d5915588c408
8177 Install/Uninstall PM gets traceback
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1031
diff
changeset
|
3369 |
self.__show_licenses() |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3370 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3371 |
def __check_if_updates_available(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3372 |
try: |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3373 |
self.catalog_loaded = False |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3374 |
self.api_o.refresh() |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3375 |
self.catalog_loaded = True |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3376 |
res = self.__get_inventory_list([], False, False) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3377 |
for pfmri, state in res: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3378 |
if state["upgradable"]: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3379 |
self.pylintstub = pfmri |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3380 |
return True |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3381 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3382 |
except api_errors.InventoryException: |
1014
dbf8576e058a
7792 Moving focus after a search sometimes clears the search results unexpectedly
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1006
diff
changeset
|
3383 |
gobject.idle_add(self.__set_empty_details_panel) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3384 |
return False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3385 |
return False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3386 |
|
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3387 |
def __g_enable_disable_update_all(self, update_available): |
773
68018dae1ed4
5645 Package Manager should have busy cursor for certain actions (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
770
diff
changeset
|
3388 |
self.w_updateall_button.set_sensitive(update_available) |
68018dae1ed4
5645 Package Manager should have busy cursor for certain actions (follow up)
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
770
diff
changeset
|
3389 |
self.w_updateall_menuitem.set_sensitive(update_available) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3390 |
self.__enable_disable_install_remove() |
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
3391 |
|
483 | 3392 |
def __enable_disable_deselect(self): |
1165
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
3393 |
if self.w_application_treeview.get_model(): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
3394 |
for row in self.w_application_treeview.get_model(): |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
3395 |
if row[enumerations.MARK_COLUMN]: |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
3396 |
self.w_deselect_menuitem.set_sensitive(True) |
788e24dc3b06
8594 Edit menu items should be more consistent with traditional Gtk+ equivalents
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1164
diff
changeset
|
3397 |
return |
483 | 3398 |
self.w_deselect_menuitem.set_sensitive(False) |
3399 |
return |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3400 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3401 |
def __catalog_refresh(self, reload_gui=True): |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3402 |
"""Update image's catalogs.""" |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3403 |
try: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3404 |
# Since the user requested the refresh, perform it |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3405 |
# immediately for all publishers. |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3406 |
self.api_o.refresh(immediate=True) |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3407 |
# Refresh will load the catalogs. |
911
0a13415002e4
6634 License information not displayed
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
906
diff
changeset
|
3408 |
self.catalog_loaded = True |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3409 |
except api_errors.PublisherError: |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3410 |
# In current implementation, this will never happen |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3411 |
# We are not refreshing specific publisher |
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3412 |
self.__catalog_refresh_done() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3413 |
raise |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3414 |
except api_errors.PermissionsException: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3415 |
#Error will already have been reported in |
714
cd9870c8faae
4987 Improve error messages for PM
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
701
diff
changeset
|
3416 |
#Manage Repository dialog |
cd9870c8faae
4987 Improve error messages for PM
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
701
diff
changeset
|
3417 |
self.__catalog_refresh_done() |
cd9870c8faae
4987 Improve error messages for PM
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
701
diff
changeset
|
3418 |
return -1 |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3419 |
except api_errors.CatalogRefreshException, cre: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3420 |
total = cre.total |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3421 |
succeeded = cre.succeeded |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3422 |
ermsg = _("Network problem.\n\n") |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3423 |
ermsg += _("Details:\n") |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3424 |
ermsg += "%s/%s" % (succeeded, total) |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3425 |
ermsg += _(" catalogs successfully updated:\n") |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3426 |
for pub, err in cre.failed: |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3427 |
if isinstance(err, HTTPError): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3428 |
ermsg += " %s: %s - %s\n" % \ |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3429 |
(err.filename, err.code, err.msg) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3430 |
elif isinstance(err, URLError): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3431 |
if err.args[0][0] == 8: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3432 |
ermsg += " %s: %s\n" % \ |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3433 |
(urlparse.urlsplit( |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3434 |
pub["origin"])[1].split(":")[0], |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3435 |
err.args[0][1]) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3436 |
else: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3437 |
if isinstance(err.args[0], \ |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3438 |
socket.timeout): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3439 |
ermsg += " %s: %s\n" % \ |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3440 |
(pub["origin"], "timeout") |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3441 |
else: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3442 |
ermsg += " %s: %s\n" % \ |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3443 |
(pub["origin"], \ |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3444 |
err.args[0][1]) |
714
cd9870c8faae
4987 Improve error messages for PM
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
701
diff
changeset
|
3445 |
elif "data" in err.__dict__ and err.data: |
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3446 |
ermsg += err.data |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3447 |
else: |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3448 |
ermsg += _("Unknown error") |
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3449 |
ermsg += "\n" |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3450 |
|
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3451 |
gobject.idle_add(self.error_occurred, ermsg, |
714
cd9870c8faae
4987 Improve error messages for PM
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
701
diff
changeset
|
3452 |
None, gtk.MESSAGE_INFO) |
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3453 |
self.__catalog_refresh_done() |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
3454 |
return -1 |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3455 |
except api_errors.InvalidDepotResponseException, idrex: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3456 |
err = str(idrex) |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3457 |
gobject.idle_add(self.error_occurred, err, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3458 |
None, gtk.MESSAGE_INFO) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3459 |
self.__catalog_refresh_done() |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3460 |
return -1 |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3461 |
except api_errors.PublisherError: |
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3462 |
self.__catalog_refresh_done() |
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3463 |
raise |
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3464 |
except Exception: |
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3465 |
self.__catalog_refresh_done() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3466 |
raise |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3467 |
if reload_gui: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3468 |
self.__catalog_refresh_done() |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
3469 |
return 0 |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3470 |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3471 |
def __add_pkgs_to_lists_from_cache(self, pub, application_list, |
892 | 3472 |
category_list, section_list): |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
3473 |
if self.cache_o: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3474 |
self.cache_o.load_application_list(pub, application_list, |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
3475 |
self.selected_pkgs) |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3476 |
self.cache_o.load_category_list(pub, category_list) |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3477 |
self.cache_o.load_section_list(pub, section_list) |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3478 |
|
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3479 |
def __add_pkgs_to_lists_from_api(self, pub, application_list, |
892 | 3480 |
category_list, section_list): |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3481 |
""" This method set up image from the given directory and |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3482 |
returns the image object or None""" |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3483 |
pargs = [] |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3484 |
pargs.append("pkg://" + pub + "/*") |
526
8c243883ae41
822 Depot traceback on "pkgsend -s <server> open foo"
Dan Price <dp@eng.sun.com>
parents:
510
diff
changeset
|
3485 |
try: |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3486 |
pkgs_known = self.__get_inventory_list(pargs, |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3487 |
True, True) |
565
1fb4f05220b9
3443 An api needs to be provided for safe interaction of front-ends
Brock Pytlik <bpytlik@sun.com>
parents:
562
diff
changeset
|
3488 |
except api_errors.InventoryException: |
1139
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3489 |
# This can happen if the repository does not |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3490 |
# contain any packages |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3491 |
err = _("Selected repository does not contain any packages.") |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3492 |
gobject.idle_add(self.w_progress_dialog.hide) |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3493 |
gobject.idle_add(self.error_occurred, err, None, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3494 |
gtk.MESSAGE_INFO) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3495 |
self.unset_busy_cursor() |
1139
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3496 |
pkgs_known = [] |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3497 |
|
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3498 |
return self.__add_pkgs_to_lists(pkgs_known, application_list, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3499 |
category_list, section_list) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3500 |
|
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3501 |
def __add_pkgs_to_lists(self, pkgs_known, application_list, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3502 |
category_list, section_list): |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3503 |
if section_list != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3504 |
self.__init_sections(section_list) |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3505 |
#Imageinfo for categories |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3506 |
update_for_category_icon = \ |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3507 |
self.get_icon_pixbuf_from_glade_dir("legend_newupdate") |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3508 |
imginfo = imageinfo.ImageInfo() |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3509 |
sectioninfo = imageinfo.ImageInfo() |
1087
293c0aa5f32e
8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents:
1074
diff
changeset
|
3510 |
pubs = [p.prefix for p in self.api_o.get_publishers()] |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3511 |
categories = {} |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3512 |
sections = {} |
701
ba35d1b02c04
4884 Package Manager corruption?
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
697
diff
changeset
|
3513 |
share_path = "/usr/share/package-manager/data/" |
1087
293c0aa5f32e
8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents:
1074
diff
changeset
|
3514 |
for pub in pubs: |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3515 |
category = imginfo.read(self.application_dir + |
1087
293c0aa5f32e
8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents:
1074
diff
changeset
|
3516 |
share_path + pub) |
701
ba35d1b02c04
4884 Package Manager corruption?
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
697
diff
changeset
|
3517 |
if len(category) == 0: |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3518 |
category = imginfo.read(self.application_dir + |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3519 |
share_path + "opensolaris.org") |
1087
293c0aa5f32e
8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents:
1074
diff
changeset
|
3520 |
categories[pub] = category |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3521 |
section = sectioninfo.read(self.application_dir + |
1087
293c0aa5f32e
8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents:
1074
diff
changeset
|
3522 |
share_path + pub + ".sections") |
701
ba35d1b02c04
4884 Package Manager corruption?
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
697
diff
changeset
|
3523 |
if len(section) == 0: |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3524 |
section = sectioninfo.read(self.application_dir + |
701
ba35d1b02c04
4884 Package Manager corruption?
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
697
diff
changeset
|
3525 |
share_path + "opensolaris.org.sections") |
1087
293c0aa5f32e
8214 load_catalogs should only load catalog data when needed
Shawn Walker <srw@sun.com>
parents:
1074
diff
changeset
|
3526 |
sections[pub] = section |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3527 |
pkg_count = 0 |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3528 |
pkg_add = 0 |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3529 |
progress_percent = INITIAL_PROGRESS_TOTAL_PERCENTAGE |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3530 |
total_pkg_count = len(pkgs_known) |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3531 |
progress_increment = \ |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3532 |
total_pkg_count / PACKAGE_PROGRESS_TOTAL_INCREMENTS |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3533 |
self.progress_stop_timer_thread = True |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3534 |
while gtk.events_pending(): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3535 |
gtk.main_iteration(False) |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3536 |
prev_stem = "" |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3537 |
prev_pfmri_str = "" |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3538 |
next_app = None |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3539 |
pkg_name = None |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3540 |
pkg_publisher = None |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3541 |
prev_state = None |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3542 |
category_icon = None |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3543 |
for pkg, state in pkgs_known: |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3544 |
if prev_pfmri_str and \ |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3545 |
prev_pfmri_str == pkg.get_short_fmri() and \ |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3546 |
prev_state == state: |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3547 |
pkg_count += 1 |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3548 |
continue |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3549 |
if prev_stem and \ |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3550 |
prev_stem == pkg.get_pkg_stem() and \ |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3551 |
prev_state["state"] == "known" and \ |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3552 |
state["state"] == "installed": |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3553 |
pass |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3554 |
elif next_app != None: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3555 |
self.__add_package_to_list(next_app, |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3556 |
application_list, |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3557 |
pkg_add, pkg_name, |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3558 |
category_icon, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3559 |
categories, category_list, pkg_publisher) |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3560 |
pkg_add += 1 |
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3561 |
prev_stem = pkg.get_pkg_stem() |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3562 |
prev_pfmri_str = pkg.get_short_fmri() |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3563 |
prev_state = state |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3564 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3565 |
if progress_increment > 0 and pkg_count % progress_increment == 0: |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3566 |
progress_percent += PACKAGE_PROGRESS_PERCENT_INCREMENT |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3567 |
if progress_percent <= PACKAGE_PROGRESS_PERCENT_TOTAL: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3568 |
self.__progressdialog_progress_percent( |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3569 |
progress_percent, pkg_count, total_pkg_count) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3570 |
while gtk.events_pending(): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3571 |
gtk.main_iteration(False) |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3572 |
|
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3573 |
status_icon = None |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3574 |
category_icon = None |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3575 |
pkg_name = pkg.get_name() |
1031
5c130cc07e44
7037 GUI to cut last all but part of new Category Path
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1028
diff
changeset
|
3576 |
pkg_name = gui_misc.get_pkg_name(pkg_name) |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3577 |
pkg_stem = pkg.get_pkg_stem() |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3578 |
pkg_publisher = pkg.get_publisher() |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3579 |
pkg_state = enumerations.NOT_INSTALLED |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3580 |
if state["state"] == "installed": |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3581 |
pkg_state = enumerations.INSTALLED |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3582 |
if state["upgradable"] == True: |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3583 |
status_icon = self.update_available_icon |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3584 |
category_icon = update_for_category_icon |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3585 |
pkg_state = enumerations.UPDATABLE |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3586 |
else: |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3587 |
status_icon = self.installed_icon |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3588 |
else: |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3589 |
status_icon = self.not_installed_icon |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3590 |
marked = False |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3591 |
if not self.is_search_all: |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3592 |
pkgs = self.selected_pkgs.get(pkg_publisher) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3593 |
if pkgs != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3594 |
if pkg_stem in pkgs: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3595 |
marked = True |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3596 |
next_app = \ |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3597 |
[ |
893
43894973bcdc
7010 Remove Blank Column together with data model.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
892
diff
changeset
|
3598 |
marked, status_icon, pkg_name, '...', pkg_state, |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3599 |
pkg, pkg_stem, None, True, None, pkg_publisher |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3600 |
] |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3601 |
pkg_count += 1 |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3602 |
|
1139
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3603 |
if next_app: |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3604 |
self.__add_package_to_list(next_app, application_list, |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3605 |
pkg_add, pkg_name, category_icon, categories, |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3606 |
category_list, pkg_publisher) |
1d9a377bb97e
7184 PM not properly behaving when repository doesn't contain any packages.
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1138
diff
changeset
|
3607 |
pkg_add += 1 |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3608 |
if category_list != None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3609 |
self.__add_categories_to_sections(sections, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3610 |
category_list, section_list) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3611 |
self.__progressdialog_progress_percent(PACKAGE_PROGRESS_PERCENT_TOTAL, |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3612 |
total_pkg_count, total_pkg_count) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3613 |
return |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3614 |
|
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3615 |
def __add_categories_to_sections(self, sections, category_list, section_list): |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3616 |
for pub in sections: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3617 |
for section in sections[pub]: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3618 |
for category in sections[pub][section].split(","): |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3619 |
self.__add_category_to_section(_(category), |
892 | 3620 |
_(section), category_list, section_list) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3621 |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3622 |
#1915 Sort the Categories into alphabetical order and prepend All Category |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3623 |
if len(category_list) > 0: |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3624 |
rows = [tuple(r) + (i,) for i, r in enumerate(category_list)] |
510
35ac691b5187
3193 IPS GUI throws exceptions when installing/upgrading a package
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
500
diff
changeset
|
3625 |
rows.sort(self.__sort) |
543
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
3626 |
r = [] |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3627 |
category_list.reorder([r[-1] for r in rows]) |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3628 |
return |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
3629 |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3630 |
def __add_package_to_list(self, app, application_list, pkg_add, |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3631 |
pkg_name, category_icon, categories, category_list, pub): |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3632 |
row_iter = application_list.insert(pkg_add, app) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3633 |
if category_list == None: |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3634 |
return |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3635 |
cat_pub = categories.get(pub) |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3636 |
if pkg_name in cat_pub: |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3637 |
pkg_categories = cat_pub.get(pkg_name) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3638 |
for pcat in pkg_categories.split(","): |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3639 |
self.__add_package_to_category(_(pcat), None, |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3640 |
category_icon, row_iter, application_list, |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3641 |
category_list) |
825
5d8b3ed4c293
6002 Two entries appear in packagemanager for installed package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
823
diff
changeset
|
3642 |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3643 |
@staticmethod |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3644 |
def __add_package_to_category(category_name, category_description, |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3645 |
category_icon, package, application_list, category_list): |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3646 |
if not package or category_name == _('All'): |
483 | 3647 |
return |
3648 |
if not category_name: |
|
3649 |
return |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3650 |
category_id = None |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3651 |
icon_visible = False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3652 |
if category_icon: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3653 |
icon_visible = True |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3654 |
for category in category_list: |
483 | 3655 |
if category[enumerations.CATEGORY_NAME] == category_name: |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3656 |
category_id = category[enumerations.CATEGORY_ID] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3657 |
if category_icon: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3658 |
category[enumerations.CATEGORY_ICON] = \ |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3659 |
category_icon |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3660 |
category[enumerations.CATEGORY_ICON_VISIBLE] = \ |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3661 |
icon_visible |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3662 |
break |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3663 |
if not category_id: # Category not exists |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3664 |
category_id = len(category_list) + 1 |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3665 |
category_list.append([category_id, category_name, |
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3666 |
category_description, category_icon, icon_visible, |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3667 |
True, None]) |
892 | 3668 |
if application_list.get_value(package, |
3669 |
enumerations.CATEGORY_LIST_COLUMN): |
|
3670 |
a = application_list.get_value(package, |
|
3671 |
enumerations.CATEGORY_LIST_COLUMN) |
|
3672 |
a.append(category_id) |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3673 |
else: |
892 | 3674 |
category_list = [] |
3675 |
category_list.append(category_id) |
|
3676 |
application_list.set(package, |
|
3677 |
enumerations.CATEGORY_LIST_COLUMN, category_list) |
|
483 | 3678 |
|
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3679 |
@staticmethod |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3680 |
def __add_category_to_section(category_name, section_name, category_list, |
892 | 3681 |
section_list): |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3682 |
'''Adds the section to section list in category. If there is no such |
483 | 3683 |
section, than it is not added. If there was already section than it |
3684 |
is skipped. Sections must be case sensitive''' |
|
3685 |
if not category_name: |
|
3686 |
return |
|
892 | 3687 |
for section in section_list: |
483 | 3688 |
if section[enumerations.SECTION_NAME] == section_name: |
892 | 3689 |
section_id = section[enumerations.SECTION_ID] |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3690 |
for category in category_list: |
483 | 3691 |
if category[enumerations.CATEGORY_NAME] == \ |
3692 |
category_name: |
|
892 | 3693 |
section_lst = category[ \ |
3694 |
enumerations.SECTION_LIST_OBJECT] |
|
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3695 |
section[enumerations.SECTION_ENABLED] = \ |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3696 |
True |
892 | 3697 |
if not section_lst: |
483 | 3698 |
category[ \ |
892 | 3699 |
enumerations.SECTION_LIST_OBJECT] = \ |
3700 |
[section_id, ] |
|
483 | 3701 |
else: |
3702 |
if not section_name in \ |
|
892 | 3703 |
section_lst: |
3704 |
section_lst.append( |
|
3705 |
section_id) |
|
483 | 3706 |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3707 |
def __progressdialog_progress_pulse(self): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3708 |
while not self.progress_stop_timer_thread: |
510
35ac691b5187
3193 IPS GUI throws exceptions when installing/upgrading a package
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
500
diff
changeset
|
3709 |
gobject.idle_add(self.w_progressbar.pulse) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3710 |
time.sleep(0.1) |
510
35ac691b5187
3193 IPS GUI throws exceptions when installing/upgrading a package
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
500
diff
changeset
|
3711 |
gobject.idle_add(self.w_progress_dialog.hide) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3712 |
self.progress_stop_timer_thread = False |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3713 |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3714 |
# For initial setup before loading package entries allow 5% of progress bar |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3715 |
# update it on a time base as we have no other way to judge progress at this point |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3716 |
def __progressdialog_progress_time(self): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3717 |
while not self.progress_stop_timer_thread and \ |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3718 |
self.progress_fraction_time_count <= \ |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3719 |
INITIAL_PROGRESS_TOTAL_PERCENTAGE: |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3720 |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3721 |
gobject.idle_add(self.w_progressbar.set_fraction, |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3722 |
self.progress_fraction_time_count) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3723 |
self.progress_fraction_time_count += \ |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3724 |
INITIAL_PROGRESS_TIME_PERCENTAGE |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3725 |
time.sleep(INITIAL_PROGRESS_TIME_INTERVAL) |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3726 |
self.progress_stop_timer_thread = False |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3727 |
self.progress_fraction_time_count = 0 |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3728 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3729 |
def __progressdialog_progress_percent(self, fraction, count, total): |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3730 |
gobject.idle_add(self.w_progressinfo_label.set_text, _( |
660
ea2809ad4582
4126 I10n update for IPS CLI PM and UM
John Rice <john.rice@sun.com>
parents:
653
diff
changeset
|
3731 |
"Processing package entries: %d of %d") % (count, total) ) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3732 |
gobject.idle_add(self.w_progressbar.set_fraction, fraction) |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3733 |
|
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3734 |
def error_occurred(self, error_msg, msg_title=None, msg_type=gtk.MESSAGE_ERROR): |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3735 |
if msg_title: |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3736 |
title = msg_title |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3737 |
else: |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3738 |
title = _("Package Manager") |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3739 |
gui_misc.error_occurred(self.w_main_window, error_msg, |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3740 |
title, msg_type, use_markup=True) |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3741 |
|
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3742 |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3743 |
msgbox = gtk.MessageDialog(parent = |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3744 |
self.w_main_window, |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3745 |
buttons = gtk.BUTTONS_CLOSE, |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3746 |
flags = gtk.DIALOG_MODAL, |
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3747 |
type = msg_type, |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3748 |
message_format = None) |
1071
175b2a595d30
8264 Error dialog text missing when an incorrect repository URL is specified
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1070
diff
changeset
|
3749 |
msgbox.set_property('text', error_msg) |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
3750 |
title = None |
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
3751 |
if msg_title: |
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
3752 |
title = msg_title |
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
3753 |
else: |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3754 |
title = _("Package Manager") |
602
cd5a41269b1e
3911 menu item, dialog header 'Manage Repositories'
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
594
diff
changeset
|
3755 |
msgbox.set_title(title) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3756 |
msgbox.run() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3757 |
msgbox.destroy() |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3758 |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3759 |
#-----------------------------------------------------------------------------# |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3760 |
# Static Methods |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3761 |
#-----------------------------------------------------------------------------# |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3762 |
|
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3763 |
#@staticmethod |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3764 |
#def N_(message): |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3765 |
# return message |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3766 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3767 |
@staticmethod |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3768 |
def __sort(a, b): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3769 |
return cmp(a[1], b[1]) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3770 |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3771 |
@staticmethod |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3772 |
def filter_cell_data_function(column, renderer, model, itr, data): |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3773 |
'''Function which sets icon size''' |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3774 |
if data == enumerations.FILTER_NAME: |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3775 |
renderer.set_property("xalign", 0) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3776 |
renderer.set_property("width", max_filter_length + 10) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3777 |
elif data == enumerations.FILTER_ICON: |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3778 |
renderer.set_property("xalign", 0) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3779 |
renderer.set_property("width", 24) |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3780 |
return |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3781 |
|
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3782 |
@staticmethod |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3783 |
def cell_data_function(column, renderer, model, itr, data): |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3784 |
'''Function which sets the background colour to black if package is |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3785 |
selected''' |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3786 |
if itr: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3787 |
if model.get_value(itr, enumerations.MARK_COLUMN): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3788 |
renderer.set_property("cell-background", "#ffe5cc") |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3789 |
renderer.set_property("cell-background-set", True) |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3790 |
else: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3791 |
renderer.set_property("cell-background-set", False) |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3792 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3793 |
@staticmethod |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3794 |
def combobox_separator(model, itr): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3795 |
return model.get_value(itr, enumerations.FILTER_NAME) == "" |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3796 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3797 |
@staticmethod |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3798 |
def combobox_id_separator(model, itr): |
896
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
3799 |
return model.get_value(itr, 0) == -1 and \ |
9e8d60765dba
6982 Addition of Repository Dropdown
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
895
diff
changeset
|
3800 |
model.get_value(itr, 1) == "" |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3801 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3802 |
@staticmethod |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3803 |
def combobox_filter_id_separator(model, itr): |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3804 |
return model.get_value(itr, 0) == -1 and \ |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3805 |
model.get_value(itr, 2) == "" |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3806 |
|
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3807 |
@staticmethod |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3808 |
def category_filter(model, itr): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3809 |
'''This function filters category in the main application view''' |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3810 |
return model.get_value(itr, enumerations.CATEGORY_VISIBLE) |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3811 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3812 |
@staticmethod |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3813 |
def get_datetime(version): |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3814 |
dt = None |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3815 |
try: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3816 |
dt = version.get_datetime() |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3817 |
except AttributeError: |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3818 |
dt = version.get_timestamp() |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3819 |
return dt |
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3820 |
|
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3821 |
@staticmethod |
636
a8306e269861
4008 Client API api.info is slow and appears to be consuming a...
John Rice <john.rice@sun.com>
parents:
608
diff
changeset
|
3822 |
def get_installed_version(api_o, pkg): |
1214
039d992c38b0
9916 Package status not updated after installation
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1213
diff
changeset
|
3823 |
info = api_o.info([pkg], True, frozenset( |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3824 |
[api.PackageInfo.STATE, api.PackageInfo.IDENTITY])) |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3825 |
found = info[api.ImageInterface.INFO_FOUND] |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3826 |
try: |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3827 |
version = found[0] |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3828 |
except IndexError: |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3829 |
version = None |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3830 |
return version |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3831 |
|
483 | 3832 |
#-----------------------------------------------------------------------------# |
3833 |
# Public Methods |
|
3834 |
#-----------------------------------------------------------------------------# |
|
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3835 |
def setup_progressdialog_show(self): |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3836 |
self.w_progress_dialog.set_title(_("Loading Repository Information")) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3837 |
self.w_progressinfo_label.set_text( |
808
6c89385ac9ff
4463 Change PM and UM to use _() as opposed to self._()
Padraig O'Briain <padraig.obriain@sun.com>
parents:
796
diff
changeset
|
3838 |
_( "Fetching package entries ...")) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3839 |
self.w_progress_cancel.hide() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3840 |
self.w_progress_dialog.show() |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
3841 |
Thread(target = self.__progressdialog_progress_time).start() |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3842 |
|
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3843 |
def setup_progressdialog_hide(self): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3844 |
self.progress_stop_timer_thread = True |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3845 |
self.w_progress_dialog.hide() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3846 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3847 |
def init_show_filter(self): |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3848 |
""" Sets up the Filter Combobox and returns the maximum length of text |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3849 |
labels it is displaying.""" |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3850 |
return self.__init_show_filter() #Initiates filter |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3851 |
|
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3852 |
def reload_packages(self): |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3853 |
self.api_o = gui_misc.get_api_object(self.image_directory, |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3854 |
self.pr, self.w_main_window) |
1164
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
3855 |
self.cache_o = self.__get_cache_obj(self.icon_theme, |
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
3856 |
self.application_dir, self.api_o) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3857 |
self.__on_reload(None) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3858 |
|
1216
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
3859 |
def is_busy_cursor_set(self): |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
3860 |
return self.gdk_window.is_visible() |
ff1b8f7a5530
9859 Focus in PM can still be changed via keyboard during a search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1214
diff
changeset
|
3861 |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3862 |
def set_busy_cursor(self): |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3863 |
self.gdk_window.show() |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
3864 |
|
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3865 |
def unset_busy_cursor(self): |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3866 |
self.gdk_window.hide() |
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
3867 |
|
483 | 3868 |
def process_package_list_start(self, image_directory): |
3869 |
self.image_directory = image_directory |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3870 |
if not self.api_o: |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3871 |
self.api_o = gui_misc.get_api_object(image_directory, |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3872 |
self.pr, self.w_main_window) |
1164
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
3873 |
self.cache_o = self.__get_cache_obj(self.icon_theme, |
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
3874 |
self.application_dir, self.api_o) |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
3875 |
self.img_timestamp = self.cache_o.get_index_timestamp() |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3876 |
self.repositories_list = self.__get_new_repositories_liststore() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3877 |
self.__setup_repositories_combobox(self.api_o, self.repositories_list) |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
3878 |
|
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3879 |
def __get_cache_obj(self, icon_theme, application_dir, api_o): |
1164
978947aae45f
9513 Some icons are installed in wrong locations
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1160
diff
changeset
|
3880 |
cache_o = cache.CacheListStores(icon_theme, application_dir, |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3881 |
api_o, self.update_available_icon, self.installed_icon, |
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
3882 |
self.not_installed_icon) |
882
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
3883 |
return cache_o |
b7593a33c0cf
6725 Add caching support for lists/categories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
878
diff
changeset
|
3884 |
|
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3885 |
def process_package_list_end(self): |
892 | 3886 |
self.__set_first_category_text() |
866 | 3887 |
self.in_startpage_startup = False |
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
3888 |
if self.update_all_proceed: |
866 | 3889 |
# TODO: Handle situation where only SUNWipkg/SUNWipg-gui have been updated |
3890 |
# in update all: bug 6357 |
|
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
3891 |
self.__on_update_all(None) |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
3892 |
self.update_all_proceed = False |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3893 |
self.setup_progressdialog_hide() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3894 |
self.__enable_disable_install_remove() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3895 |
self.update_statusbar() |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3896 |
self.in_setup = False |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3897 |
self.cancelled = False |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3898 |
if self.set_section != 0 or \ |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3899 |
self.set_show_filter != enumerations.FILTER_ALL: |
892 | 3900 |
self.__application_refilter() |
1092
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3901 |
else: |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3902 |
self.unset_busy_cursor() |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3903 |
|
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3904 |
if self.first_run or self.in_reload: |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3905 |
Thread(target = self.__enable_disable_update_all).start() |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3906 |
self.first_run = False |
533747c91289
8453 Simultaneous calls to load_catalogs on startup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1087
diff
changeset
|
3907 |
self.in_reload = False |
543
9889330c2ab5
3201 Add Dialog for setting default and removing Boot Environments
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
539
diff
changeset
|
3908 |
|
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3909 |
def get_icon_pixbuf_from_glade_dir(self, icon_name): |
869
0197953cd88a
5398 UM not following steps consistently
Padraig O'Briain <padraig.obriain@sun.com>
parents:
868
diff
changeset
|
3910 |
return gui_misc.get_pixbuf_from_path(self.application_dir + |
827
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3911 |
"/usr/share/package-manager/", icon_name) |
a3fae94c1cce
5765 Enhancements to Categories
Padraig O'Briain <padraig.obriain@sun.com>
parents:
825
diff
changeset
|
3912 |
|
483 | 3913 |
def update_statusbar(self): |
3914 |
'''Function which updates statusbar''' |
|
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3915 |
if self.statusbar_message_id > 0: |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3916 |
self.w_main_statusbar.remove(0, self.statusbar_message_id) |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3917 |
self.statusbar_message_id = 0 |
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
3918 |
search_text = self.w_searchentry.get_text() |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3919 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3920 |
if not self.in_search_mode: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3921 |
installed = 0 |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3922 |
self.selected = 0 |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3923 |
sel = 0 |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3924 |
if self.application_list == None: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3925 |
return |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3926 |
visible_publisher = self.__get_selected_publisher() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3927 |
pkgs = self.selected_pkgs.get(visible_publisher) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3928 |
if pkgs: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3929 |
self.selected = len(pkgs) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3930 |
for pkg_row in self.application_list: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3931 |
if pkg_row[enumerations.STATUS_COLUMN] == \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3932 |
enumerations.INSTALLED \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3933 |
or pkg_row[enumerations.STATUS_COLUMN] == \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3934 |
enumerations.UPDATABLE: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3935 |
installed = installed + 1 |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3936 |
if pkg_row[enumerations.MARK_COLUMN]: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3937 |
sel = sel + 1 |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3938 |
listed_str = _('%d listed') % len(self.application_list) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3939 |
sel_str = _('%d selected') % sel |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3940 |
inst_str = _('%d installed') % installed |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3941 |
status_str = _("%s: %s , %s, %s.") % (visible_publisher, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3942 |
listed_str, inst_str, sel_str) |
944
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3943 |
self.w_main_statusbar.push(0, status_str) |
82c30f24369f
6635 Need support Search across All Repositories
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
942
diff
changeset
|
3944 |
return |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3945 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3946 |
# In Search Mode |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3947 |
active = "" |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3948 |
if self.is_search_all: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3949 |
if self.__doing_search(): |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3950 |
if self.search_all_pub_being_searched != None: |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3951 |
active = "(" + \ |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
3952 |
self.search_all_pub_being_searched + ") " |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3953 |
opt_str = _('Searching... ' |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3954 |
'%(active)sfor "%(search_text)s"') % \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3955 |
{"active": active, "search_text": search_text} |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3956 |
else: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3957 |
opt_str = _('Searched All for "%s"') % (search_text) |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3958 |
else: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3959 |
search_str = _("Searched") |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3960 |
if self.__doing_search(): |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3961 |
search_str = _("Searching...") |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3962 |
visible_publisher = self.__get_selected_publisher() |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3963 |
if visible_publisher != None: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3964 |
active = "(" + visible_publisher + ") " |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3965 |
opt_str = \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3966 |
_('%(search)s %(last_active)sfor "%(search_text)s"') \ |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3967 |
% {"search": search_str, "last_active" : active, |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3968 |
"search_text" : search_text} |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3969 |
fmt_str = _("%(option_str)s: %(number)d found %(time)s") |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3970 |
time_str = "" |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3971 |
if self.search_time_sec == 1: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3972 |
time_str = _("in 1 second") |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3973 |
elif self.search_time_sec > 1: |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3974 |
time_str = _("in %d seconds") % self.search_time_sec |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3975 |
|
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3976 |
status_str = fmt_str % {"option_str" : opt_str, "number" : |
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3977 |
len(self.application_list), "time" : time_str} |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3978 |
self.w_main_statusbar.push(0, status_str) |
483 | 3979 |
|
868
3ccd83eaeaf9
6439 Accessible image descriptions not correct after sorting
Padraig O'Briain <padraig.obriain@sun.com>
parents:
866
diff
changeset
|
3980 |
def update_package_list(self, update_list): |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
3981 |
if update_list == None and self.img_timestamp: |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3982 |
return |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3983 |
visible_publisher = self.__get_selected_publisher() |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
3984 |
default_publisher = self.default_publisher |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
3985 |
self.api_o.refresh() |
1058
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
3986 |
if not self.img_timestamp: |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
3987 |
self.img_timestamp = self.cache_o.get_index_timestamp() |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
3988 |
self.__on_reload(None) |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
3989 |
return |
11da4bffbd61
8186 Mixing the pkg(1) and GUI commands causes wrong pkg states in the GUI.
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
1056
diff
changeset
|
3990 |
self.img_timestamp = self.cache_o.get_index_timestamp() |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
3991 |
visible_list = update_list.get(visible_publisher) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3992 |
if visible_list: |
1055
87169eb64bce
7866 packagemanager install failure with pre-released adobe reader package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1049
diff
changeset
|
3993 |
i = 0 |
87169eb64bce
7866 packagemanager install failure with pre-released adobe reader package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1049
diff
changeset
|
3994 |
while i < len(visible_list): |
87169eb64bce
7866 packagemanager install failure with pre-released adobe reader package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1049
diff
changeset
|
3995 |
visible_list[i] = gui_misc.get_pkg_name( |
87169eb64bce
7866 packagemanager install failure with pre-released adobe reader package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1049
diff
changeset
|
3996 |
visible_list[i]) |
87169eb64bce
7866 packagemanager install failure with pre-released adobe reader package
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1049
diff
changeset
|
3997 |
i += 1 |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3998 |
for row in self.application_list: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
3999 |
if row[enumerations.NAME_COLUMN] in visible_list: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4000 |
pkg = row[enumerations.FMRI_COLUMN] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4001 |
pkg_stem = row[enumerations.STEM_COLUMN] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4002 |
self.__remove_pkg_stem_from_list(pkg_stem) |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4003 |
if self.info_cache.has_key(pkg_stem): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4004 |
del self.info_cache[pkg_stem] |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
4005 |
package_info = self.get_installed_version( |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
4006 |
self.api_o, pkg_stem) |
1214
039d992c38b0
9916 Package status not updated after installation
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1213
diff
changeset
|
4007 |
package_installed = False |
039d992c38b0
9916 Package status not updated after installation
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1213
diff
changeset
|
4008 |
if package_info: |
039d992c38b0
9916 Package status not updated after installation
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1213
diff
changeset
|
4009 |
package_installed = \ |
039d992c38b0
9916 Package status not updated after installation
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1213
diff
changeset
|
4010 |
(package_info.state |
039d992c38b0
9916 Package status not updated after installation
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1213
diff
changeset
|
4011 |
== api.PackageInfo.INSTALLED) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4012 |
if package_installed: |
1168
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
4013 |
row[enumerations.STATUS_COLUMN] = \ |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
4014 |
enumerations.INSTALLED |
6ca02b55d252
5197 gui should not manipulate image objects
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1165
diff
changeset
|
4015 |
row[enumerations.STATUS_ICON_COLUMN] = \ |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
4016 |
self.installed_icon |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4017 |
else: |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
4018 |
row[enumerations.STATUS_COLUMN] = \ |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4019 |
enumerations.NOT_INSTALLED |
770
51cc59540c42
4341 IPS GUI and CLI list different status for some packages
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
757
diff
changeset
|
4020 |
row[enumerations.STATUS_ICON_COLUMN] = \ |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
4021 |
self.not_installed_icon |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4022 |
row[enumerations.MARK_COLUMN] = False |
1206
9ad95431706f
9710 PM search should return results incrementally
John Rice <john.rice@sun.com>
parents:
1203
diff
changeset
|
4023 |
self.__dump_datamodels(visible_publisher, |
892 | 4024 |
self.application_list, self.category_list, |
4025 |
self.section_list) |
|
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
4026 |
for pub in update_list: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
4027 |
if pub != visible_publisher: |
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
4028 |
pkg_list = update_list.get(pub) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4029 |
for pkg in pkg_list: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4030 |
pkg_stem = None |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
4031 |
if pub != default_publisher: |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4032 |
pkg_stem = "pkg://%s/%s" % \ |
1217
1e2405e83d3a
9788 pylint errors in Package Manager and Update Manager should be fixed
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1216
diff
changeset
|
4033 |
(pub, pkg) |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4034 |
else: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4035 |
pkg_stem = "pkg:/%s" % pkg |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4036 |
if pkg_stem: |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4037 |
if self.info_cache.has_key(pkg_stem): |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4038 |
del self.info_cache[pkg_stem] |
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4039 |
self.__remove_pkg_stem_from_list(pkg_stem) |
861
2a5fb898a335
4578 IPS GUI does not update the package info after upgrading
Padraig O'Briain <padraig.obriain@sun.com>
parents:
844
diff
changeset
|
4040 |
self.__process_package_selection() |
483 | 4041 |
self.__enable_disable_selection_menus() |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4042 |
self.__enable_disable_install_remove() |
483 | 4043 |
self.update_statusbar() |
871
9fc6dca6583b
6516 split the repository data models
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
869
diff
changeset
|
4044 |
Thread(target = self.__enable_disable_update_all).start() |
483 | 4045 |
|
1028
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4046 |
@staticmethod |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4047 |
def __find_root_home_dir(): |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4048 |
return_str = '/var/tmp' |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4049 |
|
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4050 |
try: |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4051 |
lines = pwd.getpwnam('root') |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4052 |
except KeyError: |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4053 |
if debug: |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4054 |
print "Error getting passwd database entry for root" |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4055 |
return return_str |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4056 |
try: |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4057 |
return_str = lines[5] |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4058 |
except IndexError: |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4059 |
if debug: |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4060 |
print "Error getting home directory for root" |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4061 |
return return_str |
4a3a17ce4334
7852 Package Manager fails at startup with NFS mounted home dir
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1024
diff
changeset
|
4062 |
|
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
4063 |
def restart_after_ips_update(self, be_name): |
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
4064 |
self.__main_application_quit(be_name) |
483 | 4065 |
|
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
4066 |
def shutdown_after_image_update(self): |
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
4067 |
info_str = _("The Update All action is now complete and " |
942
cb2774668721
6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents:
941
diff
changeset
|
4068 |
"Package Manager will close.\n\nReview the posted release notes " |
cb2774668721
6707 Text change for Update Manager dialog
John Rice <john.rice@sun.com>
parents:
941
diff
changeset
|
4069 |
"before rebooting your system:\n\n" |
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
4070 |
) |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
4071 |
self.w_ua_completed_release_label.set_text(info_str.strip('\n')) |
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
4072 |
|
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
4073 |
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:
1014
diff
changeset
|
4074 |
self.w_ua_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:
1014
diff
changeset
|
4075 |
self.w_ua_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:
1014
diff
changeset
|
4076 |
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:
1014
diff
changeset
|
4077 |
|
1123
22aa471c4112
9024 Typos in pkgmgr error popup
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1122
diff
changeset
|
4078 |
self.w_ua_completed_dialog.set_title(_("Update All Complete")) |
1023
73f73773b4c9
6358 Release Notes message after Update All needs to be updated
John Rice <john.rice@sun.com>
parents:
1014
diff
changeset
|
4079 |
self.w_ua_completed_dialog.show() |
483 | 4080 |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4081 |
############################################################################### |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4082 |
#-----------------------------------------------------------------------------# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4083 |
# Main |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4084 |
#-----------------------------------------------------------------------------# |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4085 |
|
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4086 |
def main(): |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4087 |
gtk.main() |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4088 |
return 0 |
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4089 |
|
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4090 |
if __name__ == '__main__': |
866 | 4091 |
debug = False |
1179
725eed9b5897
9442 Use Search API in PM for all searches
John Rice <john.rice@sun.com>
parents:
1168
diff
changeset
|
4092 |
debug_descriptions = False |
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
4093 |
max_filter_length = 0 |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4094 |
update_all_proceed = False |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4095 |
ua_be_name = None |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4096 |
app_path = None |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4097 |
image_dir = None |
1024
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4098 |
info_install_arg = None |
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4099 |
save_selected = _("Save selected...") |
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4100 |
save_selected_pkgs = _("Save selected packages...") |
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4101 |
reboot_needed = _("The installed package(s) require a reboot before " |
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4102 |
"installation can be completed.") |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
4103 |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4104 |
try: |
1093
264017d0a284
8504 Delay when switching from All Repositories search
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1092
diff
changeset
|
4105 |
opts, args = getopt.getopt(sys.argv[1:], "hR:U:i:", \ |
1024
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4106 |
["help", "image-dir=", "update-all=", "info-install="]) |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4107 |
except getopt.error, msg: |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
4108 |
print "%s, for help use --help" % msg |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4109 |
sys.exit(2) |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
4110 |
|
781
06837558bc07
5798 GUI Packagemanger does not start if the user's home directory is not world readable
Padraig O'Briain <padraig.obriain@sun.com>
parents:
780
diff
changeset
|
4111 |
if os.path.isabs(sys.argv[0]): |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4112 |
app_path = sys.argv[0] |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
4113 |
else: |
781
06837558bc07
5798 GUI Packagemanger does not start if the user's home directory is not world readable
Padraig O'Briain <padraig.obriain@sun.com>
parents:
780
diff
changeset
|
4114 |
cmd = os.path.join(os.getcwd(), sys.argv[0]) |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4115 |
app_path = os.path.realpath(cmd) |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
4116 |
|
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
4117 |
for option, argument in opts: |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4118 |
if option in ("-h", "--help"): |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
4119 |
print """\ |
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
4120 |
Use -R (--image-dir) to specify image directory. |
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
4121 |
Use -U (--update-all) to proceed with Update All""" |
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4122 |
sys.exit(0) |
450
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
4123 |
if option in ("-R", "--image-dir"): |
579517b41de2
1313 How to list packages I don't have installed?
Michal Pryc <Michal.Pryc@Sun.COM>
parents:
424
diff
changeset
|
4124 |
image_dir = argument |
823
0db1bfc6d455
4848 PM fails with a blank error message
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
821
diff
changeset
|
4125 |
if option in ("-U", "--update-all"): |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4126 |
update_all_proceed = True |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4127 |
ua_be_name = argument |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4128 |
if option in ("-i", "--info-install"): |
1024
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4129 |
info_install_arg = argument |
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4130 |
|
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4131 |
if image_dir == None: |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
4132 |
try: |
483 | 4133 |
image_dir = os.environ["PKG_IMAGE"] |
457
9ee1bf88afb2
1905 GUI package manager slow responsiveness
John.Rice@Sun.COM
parents:
450
diff
changeset
|
4134 |
except KeyError: |
483 | 4135 |
image_dir = os.getcwd() |
1160
5f9ba0da1277
9441 packagemanager dumps core if X-server display is not available
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1139
diff
changeset
|
4136 |
try: |
5f9ba0da1277
9441 packagemanager dumps core if X-server display is not available
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1139
diff
changeset
|
4137 |
gtk.init_check() |
5f9ba0da1277
9441 packagemanager dumps core if X-server display is not available
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1139
diff
changeset
|
4138 |
except RuntimeError, e: |
5f9ba0da1277
9441 packagemanager dumps core if X-server display is not available
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1139
diff
changeset
|
4139 |
print _("Unable to initialize gtk") |
5f9ba0da1277
9441 packagemanager dumps core if X-server display is not available
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1139
diff
changeset
|
4140 |
print str(e) |
5f9ba0da1277
9441 packagemanager dumps core if X-server display is not available
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1139
diff
changeset
|
4141 |
sys.exit(1) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
4142 |
|
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4143 |
# Setup webinstall |
1138
b45431845444
8966 PM should be able to handle p5i data from a webserver without a .p5i extension
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1137
diff
changeset
|
4144 |
if info_install_arg or len(sys.argv) == 2: |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4145 |
webinstall = webinstall.Webinstall(image_dir) |
1024
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4146 |
if len(sys.argv) == 2: |
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4147 |
info_install_arg = sys.argv[1] |
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4148 |
webinstall.process_param(info_install_arg) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
4149 |
main() |
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4150 |
sys.exit(0) |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
4151 |
|
927
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4152 |
# Setup packagemanager |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4153 |
packagemanager = PackageManager() |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4154 |
packagemanager.application_path = app_path |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4155 |
packagemanager.image_dir_arg = image_dir |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4156 |
packagemanager.update_all_proceed = update_all_proceed |
2beb452e6245
6352 Add MimeType support for adding Authorities and Packages via PM
John Rice <john.rice@sun.com>
parents:
925
diff
changeset
|
4157 |
packagemanager.ua_be_name = ua_be_name |
996
31d152a5212b
7582 pkg set-publisher --no-refresh will delete catalogs
Shawn Walker <Shawn.Walker@Sun.COM>
parents:
995
diff
changeset
|
4158 |
|
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
4159 |
while gtk.events_pending(): |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
4160 |
gtk.main_iteration(False) |
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
4161 |
|
1213
7ae0d11a54b6
9936 PM show filter usability enhancements
John Rice <john.rice@sun.com>
parents:
1212
diff
changeset
|
4162 |
max_filter_length = packagemanager.init_show_filter() |
577
cd4e8df4322b
873 Text is wrong in the General Info tab
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
576
diff
changeset
|
4163 |
|
1024
e83271f2e133
7645 Man page required for Package Manager and Update Manager
Padraig O'Briain <padraig.obriain@sun.com>
parents:
1023
diff
changeset
|
4164 |
packagemanager.process_package_list_start(image_dir) |
500
e3ac4c2d99a1
1723 startup performance 3087 shutdown too long 1915 category ordering
John Rice <john.rice@sun.com>
parents:
483
diff
changeset
|
4165 |
|
424
a767ef6bf887
2578 integrate packagemanager into ips gate
Danek Duvall <danek.duvall@sun.com>
parents:
diff
changeset
|
4166 |
main() |