def __init__(self, *args, **kwargs):
        ListView.__init__(self, *args, **kwargs)
        targets = [("text/deepin-webcasts", gtk.TARGET_SAME_APP, 1),]
        self.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_DROP, targets, gtk.gdk.ACTION_COPY)

        self.connect_after("drag-data-received", self.on_drag_data_received)
        self.connect("single-click-item", self.__on_single_click_item)
        self.connect("double-click-item", self.on_double_click_item)
        self.connect("button-press-event", self.on_button_press_event)
        self.connect("delete-select-items", self.try_emit_empty_signal)
        self.connect("right-press-items", self.on_right_press_items)

        self.set_expand_column(1)
        Dispatcher.connect("play-webcast", self.on_dispatcher_play_webcast)
        Dispatcher.connect("add-webcasts", self.on_dispatcher_add_webcasts)
        self.limit_number = 25
        WebcastDB.connect("changed", self.on_db_update_songs)
        
        self.preview_db_file = get_config_file("preview_webcasts.db")
    def __init__(self):
        gtk.VBox.__init__(self)
        SignalContainer.__init__(self)

        # Init categorys.
        self.get_categorys()
        
        # load data.
        self.__load_webcast_query()
        
        # Init webcastbar.
        self.__init_webcastbar()
        
        # Init iconview.
        self.metro_view = self.get_icon_view()
        self.metro_view_sw = self.metro_view.get_scrolled_window()
        
        self.page_box = gtk.VBox()
        self.page_box.add(self.metro_view_sw)
        
        
        # webcasts view
        self.webcast_view = self.get_webcast_view()
        self.webcast_view_sw = self.webcast_view.get_scrolled_window()
        
        # collect view
        self.collected_db_file = get_config_file("favorite_webcasts.db")
        self.collected_view = self.get_webcast_view()
        self.collected_view_sw = self.collected_view.get_scrolled_window()
        
        # Init collect view.
        
        # init listview page.
        self.init_listview_page()
        Dispatcher.connect("change-webcast", self.on_dispatcher_change_webcast)
        WebcastDB.connect("changed", self.on_db_update_songs)
        
        body_paned = HPaned(handle_color=app_theme.get_color("panedHandler"), enable_drag=True)
        body_paned.add1(self.webcastbar)
        body_paned.add2(self.page_box)
        self.add(body_paned)
    def __init__(self):
        gtk.VBox.__init__(self)
        SignalContainer.__init__(self)

        # Init categorys.
        self.get_categorys()

        # load data.
        self.__load_webcast_query()

        # Init webcastbar.
        self.__init_webcastbar()

        # Init iconview.
        self.metro_view = self.get_icon_view()
        self.metro_view_sw = self.metro_view.get_scrolled_window()

        self.page_box = gtk.VBox()
        self.page_box.add(self.metro_view_sw)

        # webcasts view
        self.webcast_view = self.get_webcast_view()
        self.webcast_view_sw = self.webcast_view.get_scrolled_window()

        # collect view
        self.collected_db_file = get_config_file("favorite_webcasts.db")
        self.collected_view = self.get_webcast_view()
        self.collected_view_sw = self.collected_view.get_scrolled_window()

        # Init collect view.

        # init listview page.
        self.init_listview_page()
        Dispatcher.connect("change-webcast", self.on_dispatcher_change_webcast)
        WebcastDB.connect("changed", self.on_db_update_songs)

        body_paned = HPaned(handle_color=app_theme.get_color("panedHandler"),
                            enable_drag=True)
        body_paned.add1(self.webcastbar)
        body_paned.add2(self.page_box)
        self.add(body_paned)
    def __init__(self, *args, **kwargs):
        ListView.__init__(self, *args, **kwargs)
        targets = [
            ("text/deepin-webcasts", gtk.TARGET_SAME_APP, 1),
        ]
        self.drag_dest_set(gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_DROP,
                           targets, gtk.gdk.ACTION_COPY)

        self.connect_after("drag-data-received", self.on_drag_data_received)
        self.connect("single-click-item", self.__on_single_click_item)
        self.connect("double-click-item", self.on_double_click_item)
        self.connect("button-press-event", self.on_button_press_event)
        self.connect("delete-select-items", self.try_emit_empty_signal)
        self.connect("right-press-items", self.on_right_press_items)

        self.set_expand_column(1)
        Dispatcher.connect("play-webcast", self.on_dispatcher_play_webcast)
        Dispatcher.connect("add-webcasts", self.on_dispatcher_add_webcasts)
        self.limit_number = 25
        WebcastDB.connect("changed", self.on_db_update_songs)

        self.preview_db_file = get_config_file("preview_webcasts.db")
 def __load_webcast_query(self):    
     self.__db_query = WebcastQuery()        
     if WebcastDB.isloaded():
         self.__on_db_loaded()
     else:    
         WebcastDB.connect("loaded", lambda obj: self.__on_db_loaded())
 def __load_webcast_query(self):
     self.__db_query = WebcastQuery()
     if WebcastDB.isloaded():
         self.__on_db_loaded()
     else:
         WebcastDB.connect("loaded", lambda obj: self.__on_db_loaded())