示例#1
0
    def _get_blacklist_iface(self):
        """
		Create a blacklist interface using the get_extension() method
		from client.py.
		"""
        del self.blacklist
        iface = ZeitgeistDBusInterface()
        blacklist = iface.get_extension("Blacklist", "blacklist")
        return blacklist
	def _get_blacklist_iface(self):
		"""
		Create a blacklist interface using the get_extension() method
		from client.py.
		"""
		del self.blacklist
		iface = ZeitgeistDBusInterface()
		blacklist = iface.get_extension("Blacklist", "blacklist")
		return blacklist
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import gtk
import gobject
from gettext import install, ngettext  # TODO: Setup translations.

from zeitgeist.datamodel import Interpretation, Manifestation, DataSource
from zeitgeist.client import ZeitgeistDBusInterface

CLIENT = ZeitgeistDBusInterface()
REGISTRY = CLIENT.get_extension("DataSourceRegistry", "data_source_registry")


class DataSourceList(gtk.TreeView):
    def __init__(self, activate_callback=None, select_callback=None):
        super(DataSourceList, self).__init__()

        self.store = gtk.TreeStore(str, str, bool, bool, gobject.TYPE_PYOBJECT)
        self.selection = self.get_selection()  # gtk.TreeSelection
        self.set_model(self.store)
        self.set_search_column(0)

        col = self._create_column(_("Name"))
        col[0].add_attribute(col[1], "text", 0)
        col = self._create_column(_("Description"))
        col[0].add_attribute(col[1], "text", 1)
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

import gtk
import gobject
from gettext import install, ngettext # TODO: Setup translations.

from zeitgeist.datamodel import Interpretation, Manifestation, DataSource
from zeitgeist.client import ZeitgeistDBusInterface

CLIENT = ZeitgeistDBusInterface()
REGISTRY = CLIENT.get_extension("DataSourceRegistry", "data_source_registry")

class DataSourceList(gtk.TreeView):
    
    def __init__(self, activate_callback=None, select_callback=None):
        super(DataSourceList, self).__init__()
        
        self.store = gtk.TreeStore(str, str, bool, bool, gobject.TYPE_PYOBJECT)
        self.selection = self.get_selection() # gtk.TreeSelection
        self.set_model(self.store)
        self.set_search_column(0)
        
        col = self._create_column(_("Name"))
        col[0].add_attribute(col[1], "text", 0)
        col = self._create_column(_("Description"))
        col[0].add_attribute(col[1], "text", 1)