2011-11-28 06:32:40 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
#
|
|
|
|
# BitBake Graphical GTK User Interface
|
|
|
|
#
|
|
|
|
# Copyright (C) 2012 Intel Corporation
|
|
|
|
#
|
|
|
|
# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
|
|
|
|
# Authored by Shane Wang <shane.wang@intel.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
import gtk
|
|
|
|
import glib
|
|
|
|
from bb.ui.crumbs.hobcolor import HobColors
|
2012-03-22 23:06:42 +00:00
|
|
|
from bb.ui.crumbs.hobwidget import HobViewTable, HobNotebook, HobAltButton, HobButton
|
2011-11-28 06:32:40 +00:00
|
|
|
from bb.ui.crumbs.hoblistmodel import PackageListModel
|
|
|
|
from bb.ui.crumbs.hobpages import HobPage
|
2012-10-25 10:36:23 +00:00
|
|
|
from bb.ui.crumbs.hobthreads import OpeningLogThread
|
2013-01-10 11:08:02 +00:00
|
|
|
from bb.ui.crumbs.hig.openinglogdialog import OpeningLogDialog
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# PackageSelectionPage
|
|
|
|
#
|
|
|
|
class PackageSelectionPage (HobPage):
|
|
|
|
|
|
|
|
pages = [
|
|
|
|
{
|
2012-09-05 11:13:48 +00:00
|
|
|
'name' : 'Included packages',
|
2012-08-31 08:48:23 +00:00
|
|
|
'tooltip' : 'The packages currently included for your image',
|
2012-03-21 02:14:09 +00:00
|
|
|
'filter' : { PackageListModel.COL_INC : [True] },
|
2011-11-28 06:32:40 +00:00
|
|
|
'columns' : [{
|
2012-03-28 16:29:13 +00:00
|
|
|
'col_name' : 'Package name',
|
2011-11-28 06:32:40 +00:00
|
|
|
'col_id' : PackageListModel.COL_NAME,
|
|
|
|
'col_style': 'text',
|
|
|
|
'col_min' : 100,
|
2012-04-06 23:02:22 +00:00
|
|
|
'col_max' : 300,
|
|
|
|
'expand' : 'True'
|
2012-03-21 02:14:09 +00:00
|
|
|
}, {
|
|
|
|
'col_name' : 'Size',
|
2011-11-28 06:32:40 +00:00
|
|
|
'col_id' : PackageListModel.COL_SIZE,
|
|
|
|
'col_style': 'text',
|
|
|
|
'col_min' : 100,
|
2012-04-06 23:02:22 +00:00
|
|
|
'col_max' : 300,
|
|
|
|
'expand' : 'True'
|
2012-09-05 11:13:48 +00:00
|
|
|
}, {
|
2012-10-16 08:52:38 +00:00
|
|
|
'col_name' : 'Brought in by (+others)',
|
2012-09-05 11:13:48 +00:00
|
|
|
'col_id' : PackageListModel.COL_BINB,
|
|
|
|
'col_style': 'binb',
|
|
|
|
'col_min' : 100,
|
|
|
|
'col_max' : 350,
|
|
|
|
'expand' : 'True'
|
2011-11-28 06:32:40 +00:00
|
|
|
}, {
|
|
|
|
'col_name' : 'Included',
|
|
|
|
'col_id' : PackageListModel.COL_INC,
|
2012-02-29 14:14:58 +00:00
|
|
|
'col_style': 'check toggle',
|
2012-04-06 23:02:22 +00:00
|
|
|
'col_min' : 100,
|
|
|
|
'col_max' : 100
|
2012-03-21 02:14:09 +00:00
|
|
|
}]
|
2011-11-28 06:32:40 +00:00
|
|
|
}, {
|
2012-03-21 02:14:09 +00:00
|
|
|
'name' : 'All packages',
|
2012-08-31 08:48:23 +00:00
|
|
|
'tooltip' : 'All packages that have been built',
|
2012-03-21 02:14:09 +00:00
|
|
|
'filter' : {},
|
2011-11-28 06:32:40 +00:00
|
|
|
'columns' : [{
|
2012-03-28 16:29:13 +00:00
|
|
|
'col_name' : 'Package name',
|
2011-11-28 06:32:40 +00:00
|
|
|
'col_id' : PackageListModel.COL_NAME,
|
|
|
|
'col_style': 'text',
|
|
|
|
'col_min' : 100,
|
2012-04-06 23:02:22 +00:00
|
|
|
'col_max' : 400,
|
|
|
|
'expand' : 'True'
|
2011-11-28 06:32:40 +00:00
|
|
|
}, {
|
2012-03-21 02:14:09 +00:00
|
|
|
'col_name' : 'Size',
|
2011-11-28 06:32:40 +00:00
|
|
|
'col_id' : PackageListModel.COL_SIZE,
|
|
|
|
'col_style': 'text',
|
|
|
|
'col_min' : 100,
|
2012-04-06 23:02:22 +00:00
|
|
|
'col_max' : 500,
|
|
|
|
'expand' : 'True'
|
2011-11-28 06:32:40 +00:00
|
|
|
}, {
|
|
|
|
'col_name' : 'Included',
|
|
|
|
'col_id' : PackageListModel.COL_INC,
|
2012-02-29 14:14:58 +00:00
|
|
|
'col_style': 'check toggle',
|
2012-04-06 23:02:22 +00:00
|
|
|
'col_min' : 100,
|
|
|
|
'col_max' : 100
|
2012-03-21 02:14:09 +00:00
|
|
|
}]
|
2011-11-28 06:32:40 +00:00
|
|
|
}
|
|
|
|
]
|
2012-08-21 15:21:23 +00:00
|
|
|
|
|
|
|
(INCLUDED,
|
|
|
|
ALL) = range(2)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
def __init__(self, builder):
|
2012-08-21 15:21:23 +00:00
|
|
|
super(PackageSelectionPage, self).__init__(builder, "Edit packages")
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
# set invisiable members
|
2012-04-09 08:41:57 +00:00
|
|
|
self.recipe_model = self.builder.recipe_model
|
2011-11-28 06:32:40 +00:00
|
|
|
self.package_model = self.builder.package_model
|
|
|
|
|
|
|
|
# create visual elements
|
|
|
|
self.create_visual_elements()
|
|
|
|
|
2012-04-13 17:48:11 +00:00
|
|
|
def included_clicked_cb(self, button):
|
2012-08-21 15:21:23 +00:00
|
|
|
self.ins.set_current_page(self.INCLUDED)
|
2012-04-13 17:48:11 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def create_visual_elements(self):
|
2012-06-22 16:08:24 +00:00
|
|
|
self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB")
|
2011-11-28 06:32:40 +00:00
|
|
|
self.eventbox = self.add_onto_top_bar(self.label, 73)
|
|
|
|
self.pack_start(self.eventbox, expand=False, fill=False)
|
|
|
|
self.pack_start(self.group_align, expand=True, fill=True)
|
|
|
|
|
2012-06-22 16:08:24 +00:00
|
|
|
# set visible members
|
Hob: implement a self-defined notebook visual component for Hob
In recipe selection page, package selection page, and build details page, etc, there is a notebook component which is not gtk.Notebook in the design video.
We implement the visual component with a drawing area, and use it to replace the old notebook in recipe selection page and package selection page. The reasons why we do it are:
1) General speaking, gtk.Notebook doesn't look like the designer worked out. (see https://wiki.yoctoproject.org/wiki/File:Hob1.2-screencast2.mov)
2) And the designer version looks better, for example, there is an indicator to show how many recipes or packages are included, and how many issues happened when building? Very straightforward.
But technically, gtk.Notebook can't implement that, as far as we know.
3) Moreover, there is an entry for "search recipes", and "search packages". How to make it horizontal to the tabs is a problem to us.
Regarding those, we give up gtk.Notebook and use our own.
(From Poky rev: e4ebac226cc5e4589bcecd8bada9fde462e925cc)
(Bitbake rev: b0c2ca3f600694c6d37924006de3f9474b2a9a8e)
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-27 05:28:26 +00:00
|
|
|
self.ins = HobNotebook()
|
2011-11-28 06:32:40 +00:00
|
|
|
self.tables = [] # we need to modify table when the dialog is shown
|
|
|
|
# append the tab
|
2012-03-16 05:40:41 +00:00
|
|
|
for page in self.pages:
|
|
|
|
columns = page['columns']
|
2012-02-29 14:14:58 +00:00
|
|
|
tab = HobViewTable(columns)
|
2012-03-16 05:40:41 +00:00
|
|
|
filter = page['filter']
|
2012-02-29 14:14:58 +00:00
|
|
|
tab.set_model(self.package_model.tree_model(filter))
|
2012-04-09 14:13:33 +00:00
|
|
|
tab.connect("toggled", self.table_toggled_cb, page['name'])
|
2012-09-05 11:13:48 +00:00
|
|
|
if page['name'] == "Included packages":
|
2012-04-05 22:32:28 +00:00
|
|
|
tab.connect("button-release-event", self.button_click_cb)
|
2012-04-09 14:13:33 +00:00
|
|
|
tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
|
2012-08-31 08:48:23 +00:00
|
|
|
self.ins.append_page(tab, page['name'], page['tooltip'])
|
2011-11-28 06:32:40 +00:00
|
|
|
self.tables.append(tab)
|
|
|
|
|
Hob: implement a self-defined notebook visual component for Hob
In recipe selection page, package selection page, and build details page, etc, there is a notebook component which is not gtk.Notebook in the design video.
We implement the visual component with a drawing area, and use it to replace the old notebook in recipe selection page and package selection page. The reasons why we do it are:
1) General speaking, gtk.Notebook doesn't look like the designer worked out. (see https://wiki.yoctoproject.org/wiki/File:Hob1.2-screencast2.mov)
2) And the designer version looks better, for example, there is an indicator to show how many recipes or packages are included, and how many issues happened when building? Very straightforward.
But technically, gtk.Notebook can't implement that, as far as we know.
3) Moreover, there is an entry for "search recipes", and "search packages". How to make it horizontal to the tabs is a problem to us.
Regarding those, we give up gtk.Notebook and use our own.
(From Poky rev: e4ebac226cc5e4589bcecd8bada9fde462e925cc)
(Bitbake rev: b0c2ca3f600694c6d37924006de3f9474b2a9a8e)
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-27 05:28:26 +00:00
|
|
|
self.ins.set_entry("Search packages:")
|
2011-11-28 06:32:40 +00:00
|
|
|
# set the search entry for each table
|
|
|
|
for tab in self.tables:
|
2012-08-31 08:48:23 +00:00
|
|
|
search_tip = "Enter a package name to find it"
|
|
|
|
self.ins.search.set_tooltip_text(search_tip)
|
|
|
|
self.ins.search.props.has_tooltip = True
|
Hob: implement a self-defined notebook visual component for Hob
In recipe selection page, package selection page, and build details page, etc, there is a notebook component which is not gtk.Notebook in the design video.
We implement the visual component with a drawing area, and use it to replace the old notebook in recipe selection page and package selection page. The reasons why we do it are:
1) General speaking, gtk.Notebook doesn't look like the designer worked out. (see https://wiki.yoctoproject.org/wiki/File:Hob1.2-screencast2.mov)
2) And the designer version looks better, for example, there is an indicator to show how many recipes or packages are included, and how many issues happened when building? Very straightforward.
But technically, gtk.Notebook can't implement that, as far as we know.
3) Moreover, there is an entry for "search recipes", and "search packages". How to make it horizontal to the tabs is a problem to us.
Regarding those, we give up gtk.Notebook and use our own.
(From Poky rev: e4ebac226cc5e4589bcecd8bada9fde462e925cc)
(Bitbake rev: b0c2ca3f600694c6d37924006de3f9474b2a9a8e)
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-27 05:28:26 +00:00
|
|
|
tab.set_search_entry(0, self.ins.search)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
# add all into the dialog
|
Hob: implement a self-defined notebook visual component for Hob
In recipe selection page, package selection page, and build details page, etc, there is a notebook component which is not gtk.Notebook in the design video.
We implement the visual component with a drawing area, and use it to replace the old notebook in recipe selection page and package selection page. The reasons why we do it are:
1) General speaking, gtk.Notebook doesn't look like the designer worked out. (see https://wiki.yoctoproject.org/wiki/File:Hob1.2-screencast2.mov)
2) And the designer version looks better, for example, there is an indicator to show how many recipes or packages are included, and how many issues happened when building? Very straightforward.
But technically, gtk.Notebook can't implement that, as far as we know.
3) Moreover, there is an entry for "search recipes", and "search packages". How to make it horizontal to the tabs is a problem to us.
Regarding those, we give up gtk.Notebook and use our own.
(From Poky rev: e4ebac226cc5e4589bcecd8bada9fde462e925cc)
(Bitbake rev: b0c2ca3f600694c6d37924006de3f9474b2a9a8e)
Signed-off-by: Liming An <limingx.l.an@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-27 05:28:26 +00:00
|
|
|
self.box_group_area.pack_start(self.ins, expand=True, fill=True)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-08-02 11:06:01 +00:00
|
|
|
self.button_box = gtk.HBox(False, 6)
|
|
|
|
self.box_group_area.pack_start(self.button_box, expand=False, fill=False)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-03-22 23:06:42 +00:00
|
|
|
self.build_image_button = HobButton('Build image')
|
2012-09-26 12:13:42 +00:00
|
|
|
#self.build_image_button.set_size_request(205, 49)
|
2012-04-09 14:13:47 +00:00
|
|
|
self.build_image_button.set_tooltip_text("Build target image")
|
2011-11-28 06:32:40 +00:00
|
|
|
self.build_image_button.set_flags(gtk.CAN_DEFAULT)
|
|
|
|
self.build_image_button.grab_default()
|
|
|
|
self.build_image_button.connect("clicked", self.build_image_clicked_cb)
|
2012-08-02 11:06:01 +00:00
|
|
|
self.button_box.pack_end(self.build_image_button, expand=False, fill=False)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-08-31 14:10:11 +00:00
|
|
|
self.back_button = HobAltButton('Cancel')
|
2011-11-28 06:32:40 +00:00
|
|
|
self.back_button.connect("clicked", self.back_button_clicked_cb)
|
2012-08-31 14:10:11 +00:00
|
|
|
self.button_box.pack_end(self.back_button, expand=False, fill=False)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-04-05 22:32:28 +00:00
|
|
|
def button_click_cb(self, widget, event):
|
|
|
|
path, col = widget.table_tree.get_cursor()
|
|
|
|
tree_model = widget.table_tree.get_model()
|
|
|
|
if path: # else activation is likely a removal
|
|
|
|
binb = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_BINB)
|
|
|
|
if binb:
|
|
|
|
self.builder.show_binb_dialog(binb)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-09-14 09:58:53 +00:00
|
|
|
def open_log_clicked_cb(self, button, log_file):
|
2012-08-02 11:06:01 +00:00
|
|
|
if log_file:
|
2012-10-25 10:36:23 +00:00
|
|
|
self.stop = False
|
|
|
|
dialog = OpeningLogDialog(title = "Opening Log",
|
|
|
|
parent = None,
|
|
|
|
flags = gtk.DIALOG_MODAL
|
|
|
|
| gtk.DIALOG_DESTROY_WITH_PARENT
|
|
|
|
| gtk.DIALOG_NO_SEPARATOR)
|
|
|
|
#create a thread to open log file
|
|
|
|
background = OpeningLogThread(dialog, log_file, self)
|
|
|
|
background.start()
|
|
|
|
response = dialog.run()
|
|
|
|
self.stop = True
|
|
|
|
background.join()
|
2012-08-02 11:06:01 +00:00
|
|
|
|
|
|
|
def show_page(self, log_file):
|
|
|
|
children = self.button_box.get_children() or []
|
|
|
|
for child in children:
|
|
|
|
self.button_box.remove(child)
|
2012-09-14 09:58:53 +00:00
|
|
|
# re-packed the buttons as request, add the 'open log' button if build success
|
2012-08-02 11:06:01 +00:00
|
|
|
self.button_box.pack_end(self.build_image_button, expand=False, fill=False)
|
|
|
|
if log_file:
|
2012-09-14 09:58:53 +00:00
|
|
|
open_log_button = HobAltButton("Open log")
|
|
|
|
open_log_button.connect("clicked", self.open_log_clicked_cb, log_file)
|
|
|
|
open_log_button.set_tooltip_text("Open the build's log file")
|
|
|
|
self.button_box.pack_end(open_log_button, expand=False, fill=False)
|
2012-08-31 14:10:11 +00:00
|
|
|
self.button_box.pack_end(self.back_button, expand=False, fill=False)
|
2012-08-02 11:06:01 +00:00
|
|
|
self.show_all()
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def build_image_clicked_cb(self, button):
|
|
|
|
self.builder.build_image()
|
|
|
|
|
|
|
|
def back_button_clicked_cb(self, button):
|
2012-09-24 13:30:59 +00:00
|
|
|
if self.builder.previous_step == self.builder.IMAGE_GENERATED:
|
2012-09-10 12:49:57 +00:00
|
|
|
self.builder.restore_initial_selected_packages()
|
|
|
|
self.refresh_selection()
|
2012-08-21 15:21:23 +00:00
|
|
|
self.builder.show_image_details()
|
2012-09-24 13:30:59 +00:00
|
|
|
else:
|
|
|
|
self.builder.show_configuration()
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
def _expand_all(self):
|
|
|
|
for tab in self.tables:
|
|
|
|
tab.table_tree.expand_all()
|
|
|
|
|
|
|
|
def refresh_selection(self):
|
|
|
|
self._expand_all()
|
|
|
|
|
|
|
|
self.builder.configuration.selected_packages = self.package_model.get_selected_packages()
|
2012-04-01 12:14:18 +00:00
|
|
|
self.builder.configuration.user_selected_packages = self.package_model.get_user_selected_packages()
|
2011-11-28 06:32:40 +00:00
|
|
|
selected_packages_num = len(self.builder.configuration.selected_packages)
|
2012-04-02 08:29:17 +00:00
|
|
|
selected_packages_size = self.package_model.get_packages_size()
|
|
|
|
selected_packages_size_str = HobPage._size_to_string(selected_packages_size)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
image_overhead_factor = self.builder.configuration.image_overhead_factor
|
2012-10-12 09:06:23 +00:00
|
|
|
image_rootfs_size = self.builder.configuration.image_rootfs_size / 1024 # image_rootfs_size is KB
|
|
|
|
image_extra_size = self.builder.configuration.image_extra_size / 1024 # image_extra_size is KB
|
2011-11-28 06:32:40 +00:00
|
|
|
base_size = image_overhead_factor * selected_packages_size
|
|
|
|
image_total_size = max(base_size, image_rootfs_size) + image_extra_size
|
2012-04-09 08:42:02 +00:00
|
|
|
if "zypper" in self.builder.configuration.selected_packages:
|
|
|
|
image_total_size += (51200 * 1024)
|
2012-04-02 08:29:17 +00:00
|
|
|
image_total_size_str = HobPage._size_to_string(image_total_size)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-04-13 17:48:11 +00:00
|
|
|
self.label.set_label("Packages included: %s\nSelected packages size: %s\nTotal image size: %s" %
|
2011-11-28 06:32:40 +00:00
|
|
|
(selected_packages_num, selected_packages_size_str, image_total_size_str))
|
2012-09-05 11:13:48 +00:00
|
|
|
self.ins.show_indicator_icon("Included packages", selected_packages_num)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-04-09 14:13:33 +00:00
|
|
|
def toggle_item_idle_cb(self, path, view_tree, cell, pagename):
|
2011-11-28 06:32:40 +00:00
|
|
|
if not self.package_model.path_included(path):
|
|
|
|
self.package_model.include_item(item_path=path, binb="User Selected")
|
|
|
|
else:
|
2012-09-05 11:13:48 +00:00
|
|
|
if pagename == "Included packages":
|
2012-04-09 14:13:33 +00:00
|
|
|
self.pre_fadeout_checkout_include(view_tree)
|
|
|
|
self.package_model.exclude_item(item_path=path)
|
|
|
|
self.render_fadeout(view_tree, cell)
|
|
|
|
else:
|
|
|
|
self.package_model.exclude_item(item_path=path)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-03-14 02:53:42 +00:00
|
|
|
self.refresh_selection()
|
2012-04-09 08:41:57 +00:00
|
|
|
if not self.builder.customized:
|
|
|
|
self.builder.customized = True
|
2012-06-01 10:40:59 +00:00
|
|
|
self.builder.configuration.selected_image = self.recipe_model.__custom_image__
|
2012-04-09 08:41:57 +00:00
|
|
|
self.builder.rcppkglist_populated()
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
self.builder.window_sensitive(True)
|
|
|
|
|
2012-04-09 14:13:33 +00:00
|
|
|
def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree, pagename):
|
2011-11-28 06:32:40 +00:00
|
|
|
# Click to include a package
|
|
|
|
self.builder.window_sensitive(False)
|
|
|
|
view_model = view_tree.get_model()
|
|
|
|
path = self.package_model.convert_vpath_to_path(view_model, view_path)
|
2012-04-09 14:13:33 +00:00
|
|
|
glib.idle_add(self.toggle_item_idle_cb, path, view_tree, cell, pagename)
|
|
|
|
|
|
|
|
def pre_fadeout_checkout_include(self, tree):
|
|
|
|
self.package_model.resync_fadeout_column(self.package_model.get_iter_first())
|
|
|
|
# Check out a model which base on the column COL_FADE_INC,
|
|
|
|
# it's save the prev state of column COL_INC before do exclude_item
|
|
|
|
filter = { PackageListModel.COL_FADE_INC : [True]}
|
|
|
|
new_model = self.package_model.tree_model(filter)
|
|
|
|
tree.set_model(new_model)
|
|
|
|
tree.expand_all()
|
|
|
|
|
|
|
|
def get_excluded_rows(self, to_render_cells, model, it):
|
|
|
|
while it:
|
|
|
|
path = model.get_path(it)
|
|
|
|
prev_cell_is_active = model.get_value(it, PackageListModel.COL_FADE_INC)
|
|
|
|
curr_cell_is_active = model.get_value(it, PackageListModel.COL_INC)
|
|
|
|
if (prev_cell_is_active == True) and (curr_cell_is_active == False):
|
|
|
|
to_render_cells.append(path)
|
|
|
|
if model.iter_has_child(it):
|
|
|
|
self.get_excluded_rows(to_render_cells, model, model.iter_children(it))
|
|
|
|
it = model.iter_next(it)
|
|
|
|
|
|
|
|
return to_render_cells
|
|
|
|
|
|
|
|
def render_fadeout(self, tree, cell):
|
|
|
|
if (not cell) or (not tree):
|
|
|
|
return
|
|
|
|
to_render_cells = []
|
2012-04-12 14:22:43 +00:00
|
|
|
view_model = tree.get_model()
|
|
|
|
self.get_excluded_rows(to_render_cells, view_model, view_model.get_iter_first())
|
2012-04-12 01:54:17 +00:00
|
|
|
|
2012-04-12 14:22:43 +00:00
|
|
|
cell.fadeout(tree, 1000, to_render_cells)
|
2012-04-12 01:54:17 +00:00
|
|
|
|
2012-04-12 14:22:43 +00:00
|
|
|
def after_fadeout_checkin_include(self, table, ctrl, cell, tree):
|
|
|
|
tree.set_model(self.package_model.tree_model(self.pages[0]['filter']))
|
|
|
|
tree.expand_all()
|
2012-05-08 11:48:07 +00:00
|
|
|
|
2012-08-21 15:21:23 +00:00
|
|
|
def set_packages_curr_tab(self, curr_page):
|
|
|
|
self.ins.set_current_page(curr_page)
|
2012-09-05 11:13:48 +00:00
|
|
|
|