# Path: mcomix/library/backend_types.py
# class _BackendObject(object):
# class _Book(_BackendObject):
# class _Collection(_BackendObject):
# class _DefaultCollection(_Collection):
# class _WatchList(object):
# class _WatchListEntry(_BackendObject):
#     def get_backend(self):
#     def __init__(self, id, name, path, pages, format, size, added):
#     def __init__(self, id, name, supercollection=None):
#     def __eq__(self, other):
#     def get_books(self, filter_string=None):
#     def get_collections(self):
#     def get_all_collections(self):
#     def add_collection(self, subcollection):
#     def __init__(self):
#     def get_books(self, filter_string=None):
#     def add_collection(self, subcollection):
#     def get_collections(self):
#     def __init__(self, backend):
#     def add_directory(self, path, collection=DefaultCollection):
#     def get_watchlist(self):
#     def scan_for_new_files(self):
#     def _scan_for_new_files_thread(self):
#     def new_files_found(self, paths, watchentry):
#     def __init__(self, directory, collection):
#     def get_new_files(self, filelist):
#     def is_valid(self):
#     def remove(self):
#     def set_collection(self, new_collection):


import os
import gtk
import gobject
from mcomix.library import backend_types
        filechooser.destroy()

        if result == gtk.RESPONSE_ACCEPT \
            and os.path.isdir(directory):

            self.library.backend.watchlist.add_directory(directory)
            self._fill_model(self._treeview.get_model())

    def _remove_cb(self, button, *args):
        """ Called when a watch list entry should be removed. """
        entry = self.get_selected_watchlist_entry()
        if entry:
            entry.remove()

            # Remove selection from list
            selection = self._treeview.get_selection()
            model, iter = selection.get_selected()
            model.remove(iter)

    def _item_selected_cb(self, selection, *args):
        """ Called when an item is selected. Enables or disables the "Remove"
        button. """
        self._remove_button.set_sensitive(selection.count_selected_rows() > 0)

    def _treeview_collection_id_to_name(self, column, cell, model, iter, *args):
        """ Maps a collection ID to the corresponding collection name. """
        id = model.get_value(iter, COL_COLLECTION_ID)
        if id != -1:
            text = self.library.backend.get_collection_name(id)
        else:

# Path: mcomix/library/backend_types.py
# class _BackendObject(object):
# class _Book(_BackendObject):
# class _Collection(_BackendObject):
# class _DefaultCollection(_Collection):
# class _WatchList(object):
# class _WatchListEntry(_BackendObject):
#     def get_backend(self):
#     def __init__(self, id, name, path, pages, format, size, added):
#     def __init__(self, id, name, supercollection=None):
#     def __eq__(self, other):
#     def get_books(self, filter_string=None):
#     def get_collections(self):
#     def get_all_collections(self):
#     def add_collection(self, subcollection):
#     def __init__(self):
#     def get_books(self, filter_string=None):
#     def add_collection(self, subcollection):
#     def get_collections(self):
#     def __init__(self, backend):
#     def add_directory(self, path, collection=DefaultCollection):
#     def get_watchlist(self):
#     def scan_for_new_files(self):
#     def _scan_for_new_files_thread(self):
#     def new_files_found(self, paths, watchentry):
#     def __init__(self, directory, collection):
#     def get_new_files(self, filelist):
#     def is_valid(self):
#     def remove(self):
#     def set_collection(self, new_collection):


# Path: mcomix/library/watchlist.py
import os
import gtk
import gobject
from mcomix.library import backend_types

        filechooser.destroy()

        if result == gtk.RESPONSE_ACCEPT \
            and os.path.isdir(directory):

            self.library.backend.watchlist.add_directory(directory)
            self._fill_model(self._treeview.get_model())

    def _remove_cb(self, button, *args):
        """ Called when a watch list entry should be removed. """
        entry = self.get_selected_watchlist_entry()
        if entry:
            entry.remove()

            # Remove selection from list
            selection = self._treeview.get_selection()
            model, iter = selection.get_selected()
            model.remove(iter)

    def _item_selected_cb(self, selection, *args):
        """ Called when an item is selected. Enables or disables the "Remove"
        button. """
        self._remove_button.set_sensitive(selection.count_selected_rows() > 0)

    def _treeview_collection_id_to_name(self, column, cell, model, iter, *args):
        """ Maps a collection ID to the corresponding collection name. """
        id = model.get_value(iter, COL_COLLECTION_ID)
        if id != -1:
            text = self.library.backend.get_collection_name(id)
        else:

            text = backend_types.DefaultCollection.name