summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorAndrei Dinu <andrei.adrianx.dinu@intel.com>2013-03-28 10:23:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-29 10:41:24 +0000
commitd08acf97c997fda5157cade7524ae7f62d7098fa (patch)
tree68f9e94f3475414a250992099895d73366017d68 /bitbake/lib/bb/ui
parent6d9f418a6ee0f598008ad679c69c39e3c29a998c (diff)
downloadpoky-d08acf97c997fda5157cade7524ae7f62d7098fa.tar.gz
bitbake: propertydialog.py : added 'Package files' functionality
Extended the packages page information with the listing of the files brought in by every package. (Bitbake rev: 42b1ce37b5c9a357108afdc01b0e9f008a84e6e3) Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/propertydialog.py94
1 files changed, 92 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py b/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
index 4420f97665..f4cf9a67d0 100644
--- a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
+++ b/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py
@@ -41,11 +41,11 @@ class PropertyDialog(CrumbsDialog):
41 41
42 super(PropertyDialog, self).__init__(title, parent, flags, buttons) 42 super(PropertyDialog, self).__init__(title, parent, flags, buttons)
43 43
44 self.properties = information 44 self.properties = information
45 45
46 if len(self.properties) == 10: 46 if len(self.properties) == 10:
47 self.create_recipe_visual_elements() 47 self.create_recipe_visual_elements()
48 elif len(self.properties) == 4: 48 elif len(self.properties) == 5:
49 self.create_package_visual_elements() 49 self.create_package_visual_elements()
50 else: 50 else:
51 self.create_information_visual_elements() 51 self.create_information_visual_elements()
@@ -56,6 +56,8 @@ class PropertyDialog(CrumbsDialog):
56 HOB_ICON_BASE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), ("icons/")) 56 HOB_ICON_BASE_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), ("icons/"))
57 ICON_PACKAGES_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('info/info_display.png')) 57 ICON_PACKAGES_DISPLAY_FILE = os.path.join(HOB_ICON_BASE_DIR, ('info/info_display.png'))
58 58
59 self.set_resizable(False)
60
59 self.table = gtk.Table(1,1,False) 61 self.table = gtk.Table(1,1,False)
60 self.table.set_row_spacings(0) 62 self.table.set_row_spacings(0)
61 self.table.set_col_spacings(0) 63 self.table.set_col_spacings(0)
@@ -86,6 +88,19 @@ class PropertyDialog(CrumbsDialog):
86 88
87 self.vbox.add(self.table) 89 self.vbox.add(self.table)
88 90
91 def treeViewTooltip( self, widget, e, tooltips, cell, emptyText="" ):
92 try:
93 (path,col,x,y) = widget.get_path_at_pos( int(e.x), int(e.y) )
94 it = widget.get_model().get_iter(path)
95 value = widget.get_model().get_value(it,cell)
96 if value in self.tooltip_items:
97 tooltips.set_tip(widget, self.tooltip_items[value])
98 tooltips.enable()
99 else:
100 tooltips.set_tip(widget, emptyText)
101 except:
102 tooltips.set_tip(widget, emptyText)
103
89 104
90 def create_package_visual_elements(self): 105 def create_package_visual_elements(self):
91 106
@@ -93,7 +108,18 @@ class PropertyDialog(CrumbsDialog):
93 binb = self.properties['binb'] 108 binb = self.properties['binb']
94 size = self.properties['size'] 109 size = self.properties['size']
95 recipe = self.properties['recipe'] 110 recipe = self.properties['recipe']
111 file_list = self.properties['files_list']
112
113 file_list = file_list.strip("{}'")
114 files_temp = ''
115 paths_temp = ''
116 files_binb = []
117 paths_binb = []
96 118
119 self.tooltip_items = {}
120
121 self.set_resizable(False)
122
97 #cleaning out the recipe variable 123 #cleaning out the recipe variable
98 recipe = recipe.split("+")[0] 124 recipe = recipe.split("+")[0]
99 125
@@ -151,9 +177,71 @@ class PropertyDialog(CrumbsDialog):
151 self.vbox.add(self.label_short) 177 self.vbox.add(self.label_short)
152 self.vbox.add(self.label_info) 178 self.vbox.add(self.label_info)
153 179
180 #################################### FILES BROUGHT BY PACKAGES ###################################
181
182 if file_list != '':
183
184 self.textWindow = gtk.ScrolledWindow()
185 self.textWindow.set_shadow_type(gtk.SHADOW_IN)
186 self.textWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
187 self.textWindow.set_size_request(100, 170)
188
189 sstatemirrors_store = gtk.ListStore(str)
190
191 self.sstatemirrors_tv = gtk.TreeView()
192 self.sstatemirrors_tv.set_rules_hint(True)
193 self.sstatemirrors_tv.set_headers_visible(True)
194 self.textWindow.add(self.sstatemirrors_tv)
195
196 self.cell1 = gtk.CellRendererText()
197 col1 = gtk.TreeViewColumn('Package files', self.cell1)
198 col1.set_cell_data_func(self.cell1, self.regex_field)
199 self.sstatemirrors_tv.append_column(col1)
200
201 for items in file_list.split(']]'):
202 if len(items) > 1:
203 paths_temp = items.split(":")[0]
204 paths_binb.append(paths_temp.strip(" ,'"))
205 files_temp = items.split(":")[1]
206 files_binb.append(files_temp.strip(" ['"))
207
208 unsorted_list = []
209
210 for items in range(len(paths_binb)):
211 if len(files_binb[items]) > 1:
212 for aduse in (files_binb[items].split(",")):
213 unsorted_list.append(paths_binb[items].split(name)[len(paths_binb[items].split(name))-1] + '/' + aduse.strip(" '"))
214
215
216 unsorted_list.sort()
217 for items in unsorted_list:
218 temp = items
219 while len(items) > 35:
220 items = items[:len(items)/2] + "" + items[len(items)/2+1:]
221 if len(items) == 35:
222 items = items[:len(items)/2] + "..." + items[len(items)/2+3:]
223 self.tooltip_items[items] = temp
224
225 sstatemirrors_store.append([str(items)])
226
227
228 self.sstatemirrors_tv.set_model(sstatemirrors_store)
229
230 tips = gtk.Tooltips()
231 tips.set_tip(self.sstatemirrors_tv, "")
232 self.sstatemirrors_tv.connect("motion-notify-event", self.treeViewTooltip, tips, 0)
233 self.sstatemirrors_tv.set_events(gtk.gdk.POINTER_MOTION_MASK)
234
235 self.vbox.add(self.textWindow)
236
154 self.vbox.show_all() 237 self.vbox.show_all()
155 238
156 239
240 def regex_field(self, column, cell, model, iter):
241 cell.set_property('text', model.get_value(iter, 0))
242 return
243
244
157 def create_recipe_visual_elements(self): 245 def create_recipe_visual_elements(self):
158 246
159 summary = self.properties['summary'] 247 summary = self.properties['summary']
@@ -166,6 +254,8 @@ class PropertyDialog(CrumbsDialog):
166 homepage = self.properties['homepage'] 254 homepage = self.properties['homepage']
167 bugtracker = self.properties['bugtracker'] 255 bugtracker = self.properties['bugtracker']
168 description = self.properties['description'] 256 description = self.properties['description']
257
258 self.set_resizable(False)
169 259
170 #cleaning out the version variable and also the summary 260 #cleaning out the version variable and also the summary
171 version = version.split(":")[1] 261 version = version.split(":")[1]