~mmcg069/software-center/Bug747172

« back to all changes in this revision

Viewing changes to softwarecenter/view/softwarepane.py

  • Committer: Matthew McGowan
  • Date: 2011-04-02 00:09:12 UTC
  • mfrom: (1617.1.50 trunk)
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110402000912-j9j7ddhfie1d5ps0
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
        self.apps_category = None
179
179
        self.apps_subcategory = None
180
180
        self.apps_search_term = None
181
 
        self.custom_list_mode = False
182
181
        # keep track of applications that have been requested to be added
183
182
        # to the Unity launcher
184
183
        self.unity_launcher_items = {}
398
397
        # we only show the prompt for apps with a desktop file
399
398
        if not appdetails.desktop_file:
400
399
            return
401
 
        self.action_bar.set_label(_("Add %s to the launcher?" % app.name))
402
400
        self.action_bar.add_button(ACTION_BUTTON_CANCEL_ADD_TO_LAUNCHER,
403
401
                                    _("Not Now"), 
404
402
                                    self.on_cancel_add_to_launcher, 
409
407
                                   app,
410
408
                                   appdetails,
411
409
                                   trans_id)
 
410
        self.action_bar.set_label(_("Add %s to the launcher?" % app.name))
412
411
        
413
412
    def on_add_to_launcher(self, app, appdetails, trans_id):
414
413
        """
427
426
                                          "",        # we set the installed_desktop_file_path *after* install
428
427
                                          trans_id)
429
428
        self.unity_launcher_items[app.pkgname] = launcher_info
430
 
        self.action_bar.unset_label()
431
429
        self.action_bar.set_label(_("%s will be added to the launcher when installation completes." % app.name))
432
430
        self.action_bar.remove_button(ACTION_BUTTON_CANCEL_ADD_TO_LAUNCHER)
433
431
        self.action_bar.remove_button(ACTION_BUTTON_ADD_TO_LAUNCHER)
541
539
            else:
542
540
                apps = appstore.nr_apps
543
541
                pkgs = appstore.nr_pkgs
544
 
 
545
 
        self.action_bar.unset_label()
546
 
        
 
542
                
 
543
        if not self.is_app_details_view_showing():
 
544
            self.action_bar.unset_label()
 
545
            
547
546
        if (appstore and 
548
547
            appstore.active and
549
548
            self.is_applist_view_showing() and
555
554
                label = gettext.ngettext("_Hide %(amount)i technical item_",
556
555
                                         "_Hide %(amount)i technical items_",
557
556
                                         pkgs) % { 'amount': pkgs, }
558
 
                self.action_bar.set_label(label, self._hide_nonapp_pkgs) 
 
557
                self.action_bar.set_label(label, link_result=self._hide_nonapp_pkgs) 
559
558
            else:
560
559
                label = gettext.ngettext("_Show %(amount)i technical item_",
561
560
                                         "_Show %(amount)i technical items_",
562
561
                                         pkgs) % { 'amount': pkgs, }
563
 
                self.action_bar.set_label(label, self._show_nonapp_pkgs)
 
562
                self.action_bar.set_label(label, link_result=self._show_nonapp_pkgs)
564
563
 
565
564
    def update_search_help(self):
566
565
        search = self.searchentry.get_text()
671
670
        LOG.debug("softwarepane query: %s" % query)
672
671
        # create new model and attach it
673
672
        seq_nr = self.refresh_seq_nr
674
 
        # In custom list mode, search should yield the exact package name.
675
673
        new_model = AppStore(self.cache,
676
674
                             self.db,
677
675
                             self.icons,
678
676
                             query,
679
677
                             limit=self.get_app_items_limit(),
680
678
                             sortmode=self.get_sort_mode(),
681
 
                             exact=self.custom_list_mode,
682
679
                             nonapps_visible = self.nonapps_visible,
683
 
                             filter=self.apps_filter)
 
680
                             filter=self.apps_filter,
 
681
                             search_term=self.apps_search_term)
684
682
 
685
683
        #print "new_model", new_model, len(new_model), seq_nr
686
684
        # between request of the new model and actual delivery other