def __init__(self, data_or_title, list_type, has_separator=False):
        TreeItem.__init__(self)
        
        self.column_index = 0
        self.side_padding = 5
        self.is_highlight = False        
        self.padding_y = 0
        self.padding_x = 8
        self.list_type = list_type        
        
        if isinstance(data_or_title, basestring):
            self.title = data_or_title
            self.data = dict()
        else:    
            self.title = data_or_title.get("title", "")
            self.data = data_or_title
            
        self.data = data_or_title
        self.has_separator = has_separator        
        self.separator_height = 4
        self.item_width = CATEGROYLIST_WIDTH
        self.item_height = 26 + self.separator_height if has_separator else 26
        self.init_pixbufs()

        self.song_view = MusicView(view_type=list_type, data=self.data)
        # self.song_view.connect("begin-add-items", self.on_songview_begin_add_items)
        # self.song_view.connect("empty-items", self.on_songview_empty_items)
        self.song_view.set_size_request(PLAYLIST_WIDTH, -1)
        
        event_manager.connect("login-success", self.on_event_login_success)
        
        self.login_box = LoginBox(lambda w: event_manager.emit("login-dialog-run"))
        self.main_box = gtk.VBox()
Esempio n. 2
0
    def __init__(self, pkg_name, pkg_version, data_manager):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.pkg_version = pkg_version
        self.data_manager = data_manager
        self.icon_pixbuf = None

        info = data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0

        button_pixbuf = app_theme.get_pixbuf(
            "button/uninstall_normal.png").get_pixbuf()
        (self.button_width, self.button_height
         ) = button_pixbuf.get_width(), button_pixbuf.get_height()
        self.button_status = BUTTON_NORMAL

        self.status = self.STATUS_NORMAL
        self.status_text = ""
        self.progress_buffer = ProgressBuffer()
Esempio n. 3
0
    def __init__(self, pkg_name, pkg_version, data_manager):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.pkg_version = pkg_version
        self.data_manager = data_manager
        self.icon_pixbuf = None

        info = self.data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0

        self.status = self.STATUS_READY_DOWNLOAD
        self.status_text = _("Dependencies analyzing")
        self.progress_buffer = ProgressBuffer()

        button_pixbuf = app_theme.get_pixbuf("button/start_normal.png").get_pixbuf()
        (self.button_width, self.button_height) = button_pixbuf.get_width(), button_pixbuf.get_height()
        self.button_status = BUTTON_NORMAL

        ### TODO: is_installed status
        self.install_status = json.dumps([])
        self.desktops = []
 def __init__(self, pkg_name, pkg_version, data_manager):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.pkg_name = pkg_name
     self.pkg_version = pkg_version
     self.data_manager = data_manager
     self.icon_pixbuf = None
     
     (self.short_desc, star, self.alias_name) = data_manager.get_item_pkg_info(self.pkg_name)
     self.star_level = get_star_level(star)
     self.star_buffer = DscStarBuffer(pkg_name)
     
     self.grade_star = 0
     
     self.status = self.STATUS_READY_DOWNLOAD
     self.status_text = _("Analyzing dependencies")
     self.progress_buffer = ProgressBuffer()
     
     button_pixbuf = app_theme.get_pixbuf("button/start_normal.png").get_pixbuf()
     (self.button_width, self.button_height) = button_pixbuf.get_width(), button_pixbuf.get_height()
     self.button_status = BUTTON_NORMAL
     
     self.is_have_desktop_file = False
    def __init__(self,
                 name,
                 ap_list,
                 setting_page,
                 slide_to_setting_page_cb,
                 send_to_crumb,
                 check_state=2,
                 font_size=DEFAULT_FONT_SIZE):

        TreeItem.__init__(self)

        self.name = name
        self.ap_list = ap_list
        self.setting = setting_page
        self.slide_to_setting = slide_to_setting_page_cb
        self.send_to_crumb = send_to_crumb
        self.font_size = font_size
        self.check_width = self.get_check_width()
        self.essid_width = self.get_essid_width(self.name)
        self.jumpto_width = self.get_jumpto_width()
        self.network_state = check_state

        self.is_last = True
        self.position = 0

        '''
        Pixbufs
        '''
        self.border_color = border_normal_color
        self.bg_color = bg_normal_color
        self.loading_pixbuf = app_theme.get_pixbuf("network/loading.png")
        self.check_pixbuf = app_theme.get_pixbuf("network/check_box-2.png")
        self.jumpto_pixbuf = app_theme.get_pixbuf("network/jump_to.png")
Esempio n. 6
0
    def __init__(self, font_size=DEFAULT_FONT_SIZE):
        TreeItem.__init__(self)
        self.entry = None
        self.height = self.get_height()
        self.ssid_buffer = EntryBuffer("")
        self.ssid_buffer.set_property('cursor-visible', False)
        self.password_buffer = EntryBuffer("")
        self.password_buffer.set_property('cursor-visible', False)

        self.ssid_buffer.connect("changed", self.entry_buffer_changed)
        self.ssid_buffer.connect("insert-pos-changed",
                                 self.entry_buffer_changed)
        self.ssid_buffer.connect("selection-pos-changed",
                                 self.entry_buffer_changed)
        self.password_buffer.connect("changed", self.entry_buffer_changed)
        self.password_buffer.connect("insert-pos-changed",
                                     self.entry_buffer_changed)
        self.password_buffer.connect("selection-pos-changed",
                                     self.entry_buffer_changed)

        self.ENTRY_COLUMN = [2, 4]
        self.entry_buffer = None
        self.is_active = False
        self.check_pixbuf = app_theme.get_pixbuf("network/check_box-2.png")
        self.jumpto_pixbuf = app_theme.get_pixbuf("network/jump_to.png")
        self.border_color = border_normal_color
        self.bg_color = bg_normal_color
Esempio n. 7
0
    def __init__(self, pkg_name, pkg_version, data_manager):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.pkg_version = pkg_version
        self.data_manager = data_manager
        self.icon_pixbuf = None

        info = self.data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0

        self.status = self.STATUS_READY_DOWNLOAD
        self.status_text = _("Dependencies analyzing")
        self.progress_buffer = ProgressBuffer()

        button_pixbuf = app_theme.get_pixbuf(
            "button/start_normal.png").get_pixbuf()
        (self.button_width, self.button_height
         ) = button_pixbuf.get_width(), button_pixbuf.get_height()
        self.button_status = BUTTON_NORMAL

        ### TODO: is_installed status
        self.install_status = json.dumps([])
        self.desktops = []
    def __init__(self, ap, setting_object=None, font_size=CONTENT_FONT_SIZE):
        TreeItem.__init__(self)
        self.ap = ap
        self.ssid = ap.get_ssid()
        self.security = ap.get_flags()
        self.strength = ap.get_strength()
        self.is_double_click = False

        self.active = False
        '''
        Pixbufs
        '''
        self.loading_pixbuf = app_theme.get_pixbuf("network/loading.png")
        self.check_pixbuf = app_theme.get_pixbuf("network/check_box-2.png")
        self.check_out_pixbuf = app_theme.get_pixbuf(
            "network/check_box_out.png")

        #self.lock_pixbuf =  app_theme.get_pixbuf("lock/lock.png")
        if self.security:
            self.strength_0 = app_theme.get_pixbuf("network/secured-0.png")
            self.strength_1 = app_theme.get_pixbuf("network/secured-1.png")
            self.strength_2 = app_theme.get_pixbuf("network/secured-2.png")
            self.strength_3 = app_theme.get_pixbuf("network/secured-3.png")
        else:

            self.strength_0 = app_theme.get_pixbuf("network/Wifi_0.png")
            self.strength_1 = app_theme.get_pixbuf("network/Wifi_1.png")
            self.strength_2 = app_theme.get_pixbuf("network/Wifi_2.png")
            self.strength_3 = app_theme.get_pixbuf("network/Wifi_3.png")
        self.jumpto_pixbuf = app_theme.get_pixbuf("network/jump_to.png")
        self.right_padding = 0
Esempio n. 9
0
    def __init__(self,
                 name,
                 ap_list,
                 setting_page,
                 slide_to_setting_page_cb,
                 send_to_crumb,
                 check_state=2,
                 font_size=DEFAULT_FONT_SIZE):

        TreeItem.__init__(self)

        self.name = name
        self.ap_list = ap_list
        self.setting = setting_page
        self.slide_to_setting = slide_to_setting_page_cb
        self.send_to_crumb = send_to_crumb
        self.font_size = font_size
        self.check_width = self.get_check_width()
        self.essid_width = self.get_essid_width(self.name)
        self.jumpto_width = self.get_jumpto_width()
        self.network_state = check_state

        self.is_last = True
        self.position = 0
        '''
        Pixbufs
        '''
        self.border_color = border_normal_color
        self.bg_color = bg_normal_color
        self.loading_pixbuf = app_theme.get_pixbuf("network/loading.png")
        self.check_pixbuf = app_theme.get_pixbuf("network/check_box-2.png")
        self.jumpto_pixbuf = app_theme.get_pixbuf("network/jump_to.png")
Esempio n. 10
0
    def __init__(self, software_info, data_manager):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = software_info['pkg_name']
        self.pkg_title = software_info['short_desc']
        self.pkg_summary = software_info['long_desc']
        self.alias_name = software_info['display_name']
        self.software_pic = software_info['software_pic']
        self.desktop_info = data_manager.get_pkg_desktop_info(self.pkg_name)
        self.data_manager = data_manager

        ## TODO: fetch install_status
        self.install_status = "uninstalled"
        self.desktops = []
        gtk.timeout_add(2000, self.data_manager.get_pkg_installed,
                        self.pkg_name, self.handle_pkg_status)

        FetchImageFromUpyun(self.software_pic,
                            self.update_software_pic).start()
        self.pixbuf = None

        self.height = 100

        self.button_status = BUTTON_NORMAL
    def __init__(self, data_or_title, list_type, has_separator=False):
        TreeItem.__init__(self)

        self.column_index = 0
        self.side_padding = 5
        self.is_highlight = False
        self.padding_y = 0
        self.padding_x = 8
        self.list_type = list_type

        if isinstance(data_or_title, basestring):
            self.title = data_or_title
            self.data = dict()
        else:
            self.title = data_or_title.get("title", "")
            self.data = data_or_title

        self.data = data_or_title
        self.has_separator = has_separator
        self.separator_height = 4
        self.item_width = CATEGROYLIST_WIDTH
        self.item_height = 26 + self.separator_height if has_separator else 26
        self.init_pixbufs()

        self.song_view = MusicView(view_type=list_type, data=self.data)
        # self.song_view.connect("begin-add-items", self.on_songview_begin_add_items)
        # self.song_view.connect("empty-items", self.on_songview_empty_items)
        self.song_view.set_size_request(PLAYLIST_WIDTH, -1)

        event_manager.connect("login-success", self.on_event_login_success)

        self.login_box = LoginBox(
            lambda w: event_manager.emit("login-dialog-run"))
        self.main_box = gtk.VBox()
    def __init__(self, pkg_name, pkg_version, data_manager):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.pkg_version = pkg_version
        self.data_manager = data_manager
        self.icon_pixbuf = None
        
        info = data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0
        
        button_pixbuf = app_theme.get_pixbuf("button/uninstall_normal.png").get_pixbuf()
        (self.button_width, self.button_height) = button_pixbuf.get_width(), button_pixbuf.get_height()
        self.button_status = BUTTON_NORMAL
        
        self.status = self.STATUS_NORMAL
        self.status_text = ""
        self.progress_buffer = ProgressBuffer()
    def __init__(self, title, is_parent=False, is_in_blacklist=False):
        '''
        init docs
        '''
        TreeItem.__init__(self)

        self.title = title

        self.item_height = 26
        self.item_width = 200

        self.draw_padding_x = 10
        self.draw_padding_y = 10

        self.column_index = 0

        self.is_hover = False
        self.is_select = False
        self.is_highlight = False

        self.is_parent = is_parent
        self.is_in_blacklist = is_in_blacklist

        if is_parent:
            self.row_index = 0
        else:
            self.row_index = 1


        self.child_offset = 10
Esempio n. 14
0
    def __init__(self, pkg_name, data_manager, keywords):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.pkg_name = pkg_name
        self.data_manager = data_manager
        self.keywords = keywords
        self.icon_pixbuf = None

        (self.alias_name, self.short_desc, self.long_desc, star) = data_manager.get_pkg_search_info(self.pkg_name)
        info = self.data_manager.get_item_pkg_info(self.pkg_name)
        self.alias_name = info[1]
        self.short_desc = info[2]
        self.long_desc = info[3]

        self.star_level = get_star_level(5.0)
        self.star_buffer = DscStarBuffer(pkg_name)

        self.grade_star = 0

        self.highlight_string = get_match_context('\n'.join([self.short_desc, self.long_desc]), self.keywords)

        self.button_status = BUTTON_NORMAL

        ### TODO: is_installed status
        self.install_status = "uninstalled"
        self.desktops = []
        self.data_manager.get_pkg_installed(self.pkg_name, self.handle_pkg_status)
    def __init__(self, connection, delete_cb, set_button_cb=None):
        TreeItem.__init__(self)
        #self.title = title
        self.connection = connection
        #self.click = click_cb
        self.delete_connection = delete_cb
        self.set_button = set_button_cb
        self.entry = None
        self.entry_buffer = EntryBuffer(connection.get_setting("connection").id)
        self.entry_buffer.set_property('cursor-visible', False)
        self.entry_buffer.connect("changed", self.entry_buffer_changed)
        self.entry_buffer.connect("insert-pos-changed", self.entry_buffer_changed)
        self.entry_buffer.connect("selection-pos-changed", self.entry_buffer_changed)
        self.child_items = []
        self.height = 30
        self.ENTRY_COLUMN = [1]
        self.is_double_click = False

        self.check_select = False
        self.is_hover = False
        self.delete_hover = False
        self.connection_active = False

        '''
        Pixbuf
        '''
        self.check_pixbuf_active = app_theme.get_pixbuf("network/check_box-1.png")
        self.delete_pixbuf_out = app_theme.get_pixbuf("network/delete-3.png")
        self.delete_pixbuf_prelight = app_theme.get_pixbuf("network/delete.png")
        self.delete_pixbuf_active = app_theme.get_pixbuf("network/delete-1.png")
Esempio n. 16
0
 def __init__(self, lrc_list):
     TreeItem.__init__(self)
     
     self.update(lrc_list)
     
     self.is_highlight = False
     self.column_index = 0
     self.default_height = 26
 def __init__(self, first_category_name, second_category_name, data_manager):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.first_category_name = first_category_name
     self.second_category_name = second_category_name
     self.data_manager = data_manager
Esempio n. 18
0
 def __init__(self, index, first_category_name, data_manager):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.index = index
     self.first_category_name = first_category_name
     self.data_manager = data_manager
 def __init__(self, index, first_category_name, data_manager):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.index = index
     self.first_category_name = first_category_name
     self.data_manager = data_manager
    def __init__(self, session_view, item):

        TreeItem.__init__(self)
        self.session_view = session_view
        self.item = item
        self.is_double_click = False
        self.check_buffer = CheckButtonBuffer(self.item.is_autostart(), CHECK_WIDTH/2 - 16, 3)
        
        self.padding_x = 10
Esempio n. 21
0
 def __init__(self, first_category_name, second_category_name,
              data_manager):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.first_category_name = first_category_name
     self.second_category_name = second_category_name
     self.data_manager = data_manager
 def __init__(self, name, add_setting_callback):
     TreeItem.__init__(self)
     self.name = name
     self.add_setting = add_setting_callback
     '''
     Pixbuf
     '''
     self.add_pixbuf_out = app_theme.get_pixbuf("network/add-1.png")
     self.add_pixbuf_active = app_theme.get_pixbuf("network/add.png")
    def __init__(self, font_size=CONTENT_FONT_SIZE):

        TreeItem.__init__(self)
        self.wifi = app_theme.get_pixbuf("network/wifi_device.png")
        self.left = app_theme.get_pixbuf("network/left.png")
        self.right = app_theme.get_pixbuf("network/right.png")

        self.devices = net_manager.device_manager.wireless_devices

        self.index = 1
Esempio n. 24
0
 def __init__(self, title, icon_name, callback=None):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 37
     self.title = title
     self.item_width = 121
     self.padding_x = 10
     self.press_callback = callback
     self.init_pixbufs(icon_name)
Esempio n. 25
0
 def __init__(self, title, column_index=0):
     TreeItem.__init__(self)
     self.column_index = column_index
     self.side_padding = 5
     self.item_height = 37
     self.title = title
     self.item_width = 160
     self.child_items = []
     self.title_padding_x = 10
     self.widget = None
Esempio n. 26
0
 def __init__(self, title, icon_name, callback=None):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 37
     self.title = title
     self.item_width = 121
     self.padding_x = 10
     self.press_callback = callback
     self.init_pixbufs(icon_name)
 def __init__(self, first_category_name, second_category_name, pkg_names, data_manager, desktop_infos):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.first_category_name = first_category_name
     self.second_category_name = second_category_name
     self.all_pkg_names = pkg_names
     self.data_manager = data_manager
     self.all_desktop_infos = desktop_infos
Esempio n. 28
0
    def __init__(self, session_view, item):

        TreeItem.__init__(self)
        self.session_view = session_view
        self.item = item
        self.is_double_click = False
        self.check_buffer = CheckButtonBuffer(self.item.is_autostart(),
                                              CHECK_WIDTH / 2 - 16, 3)

        self.padding_x = 10
    def __init__(self, song):

        TreeItem.__init__(self)

        self.update(song)
        self.height = 26

        self.is_highlight = False
        self.column_index = 0

        self.default_height = 26
Esempio n. 30
0
    def __init__(self, song):

        TreeItem.__init__(self)

        self.update(song)
        self.height = 26

        self.is_highlight = False
        self.column_index = 0

        self.default_height = 26
Esempio n. 31
0
    def __init__(self, title):
        TreeItem.__init__(self)
        self.column_index = 0
        self.side_padding = 5

        self.title = title
        self.item_width = 121
        self.padding_x = 10
        self.padding_y = 5
        self.item_height = 37 + self.padding_y * 2 + 1
        self.collect_flag = True
        self.init_icon_dpixbuf()
        self.icon_width = self.normal_dpixbuf.get_pixbuf().get_width()
    def __init__(self, song, extend=False):

        TreeItem.__init__(self)

        self.song_error = False
        self.update(song)
        self.extend = extend
        self.height = 26

        self.is_highlight = False
        self.column_index = 0

        self.default_height = 26
    def __init__(self, title):
        TreeItem.__init__(self)
        self.column_index = 0
        self.side_padding = 5

        self.title = title
        self.item_width = 121
        self.padding_x = 10
        self.padding_y = 5
        self.item_height = 37 + self.padding_y * 2 + 1
        self.collect_flag = True
        self.init_icon_dpixbuf()
        self.icon_width = self.normal_dpixbuf.get_pixbuf().get_width()
Esempio n. 34
0
    def __init__(self, song, extend=False):

        TreeItem.__init__(self)

        self.song_error = False
        self.update(song)
        self.extend = extend
        self.height = 26

        self.is_highlight = False
        self.column_index = 0

        self.default_height = 26
Esempio n. 35
0
    def __init__(self, title, allocate_widget, column_index=0):
        TreeItem.__init__(self)
        self.column_index = column_index
        self.side_padding = 5
        if column_index > 0:
            self.item_height = 30
        else:
            self.item_height = 37

        self.title = title
        self.item_width = 36
        self.allocate_widget = allocate_widget
        self.title_padding_x = 30
        self.column_offset = 15
 def __init__(self, data_manager, recommend_status):
     '''
     init docs
     '''
     TreeItem.__init__(self)
     self.name = _("Home")
     self.data_manager = data_manager
     self.recommend_status = recommend_status
     
     self.page_cache = {}
     self.page_name = ['recommend', 'album', 'download_rank']
     
     self.init_recommend_page()
     global_event.register_event('download-home-infos-finish', self.update_home_page)
 def __init__(self, title, allocate_widget, column_index=0):
     TreeItem.__init__(self)
     self.column_index = column_index
     self.side_padding = 5
     if column_index > 0:
         self.item_height = 30
     else:    
         self.item_height = 37
         
     self.title = title
     self.item_width = 36
     self.allocate_widget = allocate_widget
     self.title_padding_x = 30
     self.column_offset = 15
 def __init__(self, title, callback=None):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 37
     self.title = utils.xmlescape(title)
     self.item_width = 121
     self.hover_bg = app_theme.get_pixbuf("webcast/categroy_bg.png").get_pixbuf()
     self.press_callback = callback
     
     self.parent_widget = None
     self.item_index = -1
     self.has_icon = False
     self.webcast_key = ""
Esempio n. 39
0
 def __init__(self, title, widget, column_index=0):
     TreeItem.__init__(self)
     self.column_index = column_index
     self.side_padding = 5
     if column_index > 0:
         self.item_height = 30
     else:    
         self.item_height = 37
         
     self.title = title
     self.item_width = -1
     self.title_padding_x = 4
     self.column_offset = 15
     self.widget = widget
     self.is_highlight = False
    def __init__(self, content, sp, code):
        TreeItem.__init__(self)
        self.content = content
        self.sp = sp
        self.code = code
        self.gsm_providers = sp.get_country_gsm_providers_name(code)
        self.is_expand = False
        self.show_arrow = False
        self.arrow_right=ui_theme.get_pixbuf("treeview/arrow_right.png")
        self.arrow_down=ui_theme.get_pixbuf("treeview/arrow_down.png")
        self.arrow_height = self.arrow_down.get_pixbuf().get_height()
        self.arrow_width = self.arrow_down.get_pixbuf().get_width()

        self.show_arrow = self.add_apns_name(code, content)
        self.is_hover = False
Esempio n. 41
0
    def __init__(self, title, callback=None):
        TreeItem.__init__(self)
        self.column_index = 0
        self.side_padding = 5
        self.item_height = 37
        self.title = utils.xmlescape(title)
        self.item_width = 121
        self.hover_bg = app_theme.get_pixbuf(
            "webcast/categroy_bg.png").get_pixbuf()
        self.press_callback = callback

        self.parent_widget = None
        self.item_index = -1
        self.has_icon = False
        self.webcast_key = ""
    def __init__(self, content, sp, code):
        TreeItem.__init__(self)
        self.content = content
        self.sp = sp
        self.code = code
        self.gsm_providers = sp.get_country_gsm_providers_name(code)
        self.is_expand = False
        self.show_arrow = False
        self.arrow_right = ui_theme.get_pixbuf("treeview/arrow_right.png")
        self.arrow_down = ui_theme.get_pixbuf("treeview/arrow_down.png")
        self.arrow_height = self.arrow_down.get_pixbuf().get_height()
        self.arrow_width = self.arrow_down.get_pixbuf().get_width()

        self.show_arrow = self.add_apns_name(code, content)
        self.is_hover = False
Esempio n. 43
0
    def __init__(self, data_manager, recommend_status):
        '''
        init docs
        '''
        TreeItem.__init__(self)
        self.name = _("Home")
        self.data_manager = data_manager
        self.recommend_status = recommend_status

        self.page_cache = {}
        self.page_name = ['recommend', 'album', 'download_rank']

        self.init_recommend_page()
        global_event.register_event('download-home-infos-finish',
                                    self.update_home_page)
    def __init__(self, list_data, is_online_list=False, is_login_item=False):
        TreeItem.__init__(self)

        self.column_index = 0
        self.side_padding = 5
        self.is_highlight = False
        self.padding_y = 0
        self.padding_x = 8

        if isinstance(list_data, basestring):
            self.title = list_data
            self.data = dict()
            self.list_type = self.PLAYING_LIST_TYPE
        else:
            self.title = list_data.get("name", "")
            self.data = list_data
            #self.list_id = list_data.get('id', '')

        self.data = list_data
        if is_online_list:
            if self.data['specialType'] == 5:
                self.list_type = self.FAVORITE_LIST_TYPE
            elif self.data['subscribed']:
                self.list_type = self.COLLECTED_LIST_TYPE
            else:
                self.list_type = self.CREATED_LIST_TYPE
        else:
            self.list_type = self.PLAYING_LIST_TYPE
        if is_login_item:
            self.list_type = self.LOGIN_LIST_TYPE
        self.has_separator = 1
        self.separator_height = 4
        self.item_width = CATEGROYLIST_WIDTH
        self.item_height = 26 + self.separator_height if self.has_separator else 26
        self.init_pixbufs()

        self.song_view = MusicView(data=self.data, view_type=self.list_type)
        self.song_view.set_size_request(PLAYLIST_WIDTH, -1)

        if is_login_item:
            self.login_box = LoginBox(lambda w:
                    event_manager.emit("login"))

            event_manager.connect("login", self.login)

        #event_manager.connect("login-success", self.on_event_login_success)

        self.main_box = gtk.VBox()
Esempio n. 45
0
    def __init__(self, mirror, item_clicked_callback=None):

        TreeItem.__init__(self)
        self.mirror = mirror
        self.radio_button = SelectedButtonBuffer(render_padding_x=2, render_padding_y=4)


        self.pixbuf_normal = app_theme.get_pixbuf("mirror/server_small_normal.png").get_pixbuf()
        self.pixbuf_hover = app_theme.get_pixbuf("mirror/server_small_hover.png").get_pixbuf()
        self.pixbuf_press = app_theme.get_pixbuf("mirror/server_small_press.png").get_pixbuf()

        (self.button_width, self.button_height) = self.pixbuf_normal.get_width(), self.pixbuf_normal.get_height()
        self.button_status = self.BUTTON_NORMAL

        if item_clicked_callback:
            self.connect('item-clicked', item_clicked_callback)
Esempio n. 46
0
 def __init__(self, plugin, pluginfo, enabled):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 25
     self.pluginfo = pluginfo
     self.version_width = 60
     self.enable_width = 60
     self.name_width = 100
     self.block_width = 10
     
     self.draw_padding_x = 5
     self.enabled = enabled
     self.plugin = plugin
     self.enabled_normal_dpixbuf = app_theme.get_pixbuf("webcast/collect_normal.png")
     self.enabled_press_dpixbuf = app_theme.get_pixbuf("webcast/collect_press.png")
 def __init__(self, plugin, pluginfo, enabled):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 25
     self.pluginfo = pluginfo
     self.version_width = 60
     self.enable_width = 60
     self.name_width = 100
     self.block_width = 10
     
     self.draw_padding_x = 5
     self.enabled = enabled
     self.plugin = plugin
     self.enabled_normal_dpixbuf = app_theme.get_pixbuf("webcast/collect_normal.png")
     self.enabled_press_dpixbuf = app_theme.get_pixbuf("webcast/collect_press.png")
Esempio n. 48
0
    def __init__(self, mirror, item_clicked_callback=None):

        TreeItem.__init__(self)
        self.mirror = mirror
        self.radio_button = SelectedButtonBuffer(render_padding_x=2, render_padding_y=4)


        self.pixbuf_normal = app_theme.get_pixbuf("mirror/server_small_normal.png").get_pixbuf()
        self.pixbuf_hover = app_theme.get_pixbuf("mirror/server_small_hover.png").get_pixbuf()
        self.pixbuf_press = app_theme.get_pixbuf("mirror/server_small_press.png").get_pixbuf()

        (self.button_width, self.button_height) = self.pixbuf_normal.get_width(), self.pixbuf_normal.get_height()
        self.button_status = self.BUTTON_NORMAL

        if item_clicked_callback:
            self.connect('item-clicked', item_clicked_callback)
Esempio n. 49
0
    def __init__(self, list_data, is_online_list=False, is_login_item=False):
        TreeItem.__init__(self)

        self.column_index = 0
        self.side_padding = 5
        self.is_highlight = False
        self.padding_y = 0
        self.padding_x = 8

        if isinstance(list_data, basestring):
            self.title = list_data
            self.data = dict()
            self.list_type = self.PLAYING_LIST_TYPE
        else:
            self.title = list_data.get("name", "")
            self.data = list_data
            #self.list_id = list_data.get('id', '')

        self.data = list_data
        if is_online_list:
            if self.data['specialType'] == 5:
                self.list_type = self.FAVORITE_LIST_TYPE
            elif self.data['subscribed']:
                self.list_type = self.COLLECTED_LIST_TYPE
            else:
                self.list_type = self.CREATED_LIST_TYPE
        else:
            self.list_type = self.PLAYING_LIST_TYPE
        if is_login_item:
            self.list_type = self.LOGIN_LIST_TYPE
        self.has_separator = 1
        self.separator_height = 4
        self.item_width = CATEGROYLIST_WIDTH
        self.item_height = 26 + self.separator_height if self.has_separator else 26
        self.init_pixbufs()

        self.song_view = MusicView(data=self.data, view_type=self.list_type)
        self.song_view.set_size_request(PLAYLIST_WIDTH, -1)

        if is_login_item:
            self.login_box = LoginBox(lambda w: event_manager.emit("login"))

            event_manager.connect("login", self.login)

        #event_manager.connect("login-success", self.on_event_login_success)

        self.main_box = gtk.VBox()
 def __init__(self, 
              text, 
              # search_string,
              text_size = DEFAULT_FONT_SIZE,
              padding_x = 10,
              padding_y = 6):
     '''
     init docs
     '''
     # Init.
     TreeItem.__init__(self)
     self.text = text
     # self.search_string = search_string
     self.text_size = text_size
     self.padding_x = padding_x
     self.padding_y = padding_y
     (self.text_width, self.text_height) = get_content_size(self.text)
 def __init__(self, title, webcast_key, sourcebar, index, show_icon=False):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 37
     self.title = utils.xmlescape(title)
     self.item_width = 121
     self.webcast_key = webcast_key
     self.hover_bg = app_theme.get_pixbuf("webcast/categroy_bg.png").get_pixbuf()
     self.selected_pixbuf = app_theme.get_pixbuf("webcast/source_sselect.png").get_pixbuf()
     owner_keys = WebcastsDB.get_keys_from_categroy(webcast_key)
     panel_items = [PanelItem(webcast_key, key, sourcebar) for key in owner_keys]
     self.popup_panel = PopupPanel()
     self.popup_panel.add_items(panel_items)
     self.parent_widget = sourcebar
     self.item_index = index
     self.has_icon = show_icon
 def __init__(self, title, category):
     TreeItem.__init__(self)
     self.column_index = 0
     self.side_padding = 5
     self.item_height = 37
     self.title = title
     self.item_width = 121
     self.padding_x = 10
     self.category = category
     
     if self.category.startswith("region"):
         self.init_icon_dpixbuf("region")
     elif self.category.startswith("genre"):    
         self.init_icon_dpixbuf("genre")
     else:    
         self.init_icon_dpixbuf("composite")
         
     self.icon_width = self.normal_dpixbuf.get_pixbuf().get_width()
Esempio n. 53
0
    def __init__(self, title, category):
        TreeItem.__init__(self)
        self.column_index = 0
        self.side_padding = 5
        self.item_height = 37
        self.title = title
        self.item_width = 121
        self.padding_x = 10
        self.category = category

        if self.category.startswith("region"):
            self.init_icon_dpixbuf("region")
        elif self.category.startswith("genre"):
            self.init_icon_dpixbuf("genre")
        else:
            self.init_icon_dpixbuf("composite")

        self.icon_width = self.normal_dpixbuf.get_pixbuf().get_width()