def _append_sub_toprated(self): self.toprated = FlowableGrid() self.toprated.set_row_spacing(6) self.toprated.set_column_spacing(6) self.toprated_frame = FramedHeaderBox() self.toprated_frame.pack_start(self.toprated, True, True, 0) self.vbox.pack_start(self.toprated_frame, False, True, 0) return
def _append_subcat_departments(self): self.subcat_label = Gtk.Label() self.subcat_label.set_alignment(0, 0.5) self.departments = FlowableGrid(paint_grid_pattern=False) self.departments.set_row_spacing(StockEms.SMALL) self.departments.set_column_spacing(StockEms.SMALL) frame = FramedBox(spacing=StockEms.MEDIUM, padding=StockEms.MEDIUM) # set x/y-alignment and x/y-expand frame.set(0.5, 0.0, 1.0, 1.0) frame.pack_start(self.subcat_label, False, False, 0) frame.pack_start(self.departments, True, True, 0) # append the departments section to the page self.vbox.pack_start(frame, False, True, 0) return
def _append_whats_new(self): self.whats_new = FlowableGrid() self.whats_new_frame = FramedHeaderBox() self.whats_new_frame.set_header_label(_(u"What\u2019s New")) self.whats_new_frame.add(self.whats_new) whats_new_cat = self._update_whats_new_content() if whats_new_cat is not None: # only add to the visible right_frame if we actually have it self.right_column.pack_start(self.whats_new_frame, True, True, 0) self.whats_new_frame.header_implements_more_button() self.whats_new_frame.more.connect('clicked', self.on_category_clicked, whats_new_cat)
def _update_recommended_for_you_content(self): # destroy the old content to ensure we don't see it twice if self.recommended_for_you_content: self.recommended_for_you_content.destroy() # add the new stuff self.recommended_for_you_content = FlowableGrid() self.add(self.recommended_for_you_content) self.spinner_notebook.show_spinner(_(u"Receiving recommendations…")) # get the recommendations from the recommender agent self.recommended_for_you_cat = RecommendedForYouCategory( subcategory=self.subcategory) self.recommended_for_you_cat.connect( 'needs-refresh', self._on_recommended_for_you_agent_refresh) self.recommended_for_you_cat.connect('recommender-agent-error', self._on_recommender_agent_error)
def _append_top_rated(self): self.top_rated = FlowableGrid() #~ self.top_rated.row_spacing = StockEms.SMALL self.top_rated_frame = FramedHeaderBox() self.top_rated_frame.set_header_label(_("Top Rated")) self.top_rated_frame.add(self.top_rated) self.right_column.pack_start(self.top_rated_frame, True, True, 0) top_rated_cat = self._update_top_rated_content() # only display the 'More' LinkButton if we have top_rated content if top_rated_cat is not None: self.top_rated_frame.header_implements_more_button() self.top_rated_frame.more.connect('clicked', self.on_category_clicked, top_rated_cat) return
def __init__(self, catview): RecommendationsPanel.__init__(self, catview) self.set_header_label(_(u"People Also Installed")) self.app_recommendations_content = FlowableGrid() self.add(self.app_recommendations_content)