Ejemplo n.º 1
0
 def filter(self, *args):
     "Filters preslist by the keywords."
     preslist = exposong.preslist.preslist
     if self.get_text() == "":
         if preslist.get_model() == self.__fmodel:
             preslist.set_model(preslist.get_model().get_model())
         self.__fmodel = None
     else:
         if preslist.get_model() == self.__fmodel:
             self.__fmodel = preslist.get_model().get_model().filter_new()
         else:
             self.__fmodel = preslist.get_model().filter_new()
         self.__fmodel.set_visible_func(self._visible_func)
         preslist.set_model(self.__fmodel)
Ejemplo n.º 2
0
    def _on_schedule_activate(self, *args):
        "Change the presentation list to the current schedule."
        preslist = exposong.preslist.preslist
        if self.has_selection():
            sched = self.get_active_item()
            if isinstance(sched, exposong.schedule.Schedule):
                preslist.set_model(sched.get_model())
                preslist.columns_autosize()
                if sched.is_reorderable():
                    preslist.enable_model_drag_dest(DRAGDROP_SCHEDULE, gtk.gdk.ACTION_DEFAULT)
                else:
                    preslist.unset_rows_drag_dest()
                    exposong.presfilter.presfilter.filter()
        try:
            enable = isinstance(sched, exposong.schedule.Schedule) and not sched.is_builtin()
        except UnboundLocalError:
            enable = False

        self._actions.get_action("sched-rename").set_sensitive(enable)
        self._actions.get_action("sched-delete").set_sensitive(enable)

        preslist.get_model().connect("row-changed", preslist._on_pres_added)