当前位置: 首页>>代码示例>>Python>>正文


Python WidgetStateStore.get_standard_view_type方法代码示例

本文整理汇总了Python中miro.frontends.widgets.widgetstatestore.WidgetStateStore.get_standard_view_type方法的典型用法代码示例。如果您正苦于以下问题:Python WidgetStateStore.get_standard_view_type方法的具体用法?Python WidgetStateStore.get_standard_view_type怎么用?Python WidgetStateStore.get_standard_view_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在miro.frontends.widgets.widgetstatestore.WidgetStateStore的用法示例。


在下文中一共展示了WidgetStateStore.get_standard_view_type方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_standard_view_type [as 别名]
    def __init__(self, device):
        self.device = device
        self.id = device.id
        tab_type = device.tab_type
        self.type = u'device-%s' % tab_type
        if tab_type == 'audio':
            self.titlebar_class = itemlistwidgets.DeviceMusicTitlebar
        else:
            self.titlebar_class = itemlistwidgets.DeviceVideosTitlebar

        itemlistcontroller.AudioVideoItemsController.__init__(self)
        if (u'%s_sort_state' % tab_type) in device.database:
            sort_key, ascending = device.database[u'%s_sort_state' % tab_type]
            for view in self.views.keys():
                self.on_sort_changed(self, sort_key, ascending, view)
        if (u'%s_view' % tab_type) in device.database:
            view_name = device.database[u'%s_view' % tab_type]
            if view_name  == u'list':
                view_type = WidgetStateStore.get_list_view_type()
            else:
                view_type = WidgetStateStore.get_standard_view_type()
        elif tab_type == 'audio':
            view_type = WidgetStateStore.get_list_view_type()
        else:
            view_type = WidgetStateStore.get_standard_view_type()

        self.set_view(None, view_type)

        self.titlebar.connect('list-view-clicked', self.save_view, 'list')
        self.titlebar.connect('normal-view-clicked',
                                    self.save_view, 'normal')
开发者ID:kmshi,项目名称:miro,代码行数:33,代码来源:devicecontroller.py

示例2: _init_widget

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_standard_view_type [as 别名]
 def _init_widget(self):
     itemlistcontroller.SimpleItemListController._init_widget(self)
     standard_view = WidgetStateStore.get_standard_view_type()
     # 17408: the hotspot handler in the standard view need access to the
     # playlist id to be able to ditch an item.
     self.views[standard_view].playlist_id = self.id
     self.make_drop_handler()
开发者ID:bluezone,项目名称:miro,代码行数:9,代码来源:playlist.py

示例3: test_view_types

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_standard_view_type [as 别名]
    def test_view_types(self):
        # test that all view types are different
        view_types = (WidgetStateStore.get_list_view_type(),
                WidgetStateStore.get_standard_view_type(),
                WidgetStateStore.get_album_view_type())

        for i in range(len(view_types)):
            for j in range(i + 1, len(view_types)):
                self.assertNotEqual(view_types[i], view_types[j])
开发者ID:CodeforEvolution,项目名称:miro,代码行数:11,代码来源:widgetstateconstantstest.py

示例4: _init_widget

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_standard_view_type [as 别名]
    def _init_widget(self):
        toolbar = self.build_header_toolbar()
        self.selected_view = app.widget_state.get_selected_view(self.type,
                                                                self.id)
        self.widget = itemlistwidgets.ItemContainerWidget(toolbar,
                self.selected_view)

        self.build_widget()

        list_view = WidgetStateStore.get_list_view_type()
        self.views[list_view] = self.build_list_view()

        self.expand_or_contract_item_details()

        standard_view = WidgetStateStore.get_standard_view_type()
        standard_view_widget = itemlistwidgets.StandardView(
            self.item_list, self.build_renderer())
        self.views[standard_view] = standard_view_widget
        standard_view_background = widgetset.SolidBackground(
                standard_view_widget.BACKGROUND_COLOR)
        standard_view_background.add(widgetutil.pad(standard_view_widget,
            top=10, bottom=10))

        # set up member attrs to easily get our list/standard view widgets
        self.list_item_view = self.views[list_view]
        self.standard_item_view = self.views[standard_view]
        self.standard_view_toolbar = toolbar
        
        standard_view_scroller = widgetset.Scroller(False, True)
        standard_view_scroller.add(standard_view_background)
        self.widget.vbox[standard_view].pack_start(
                standard_view_scroller, expand=True)
        self.views[standard_view].set_scroller(standard_view_scroller)
        standard_view_scroller.set_background_color(
                standard_view_widget.BACKGROUND_COLOR)

        toolbar.connect_weak('sort-changed',
            self.on_sort_changed, standard_view)
        self.widget.item_details.expander_button.connect_weak('clicked',
                self.on_item_details_expander_clicked)
        self.list_item_view.connect_weak('sort-changed',
            self.on_sort_changed, list_view)
        self.titlebar.connect_weak('list-view-clicked',
            self.set_view, list_view)
        self.titlebar.connect_weak('normal-view-clicked',
            self.set_view, standard_view)
        self.titlebar.connect_weak('resume-playing', self.on_resume_playing)
        self.standard_item_view.renderer.signals.connect_weak(
                'throbber-drawn', self.on_throbber_drawn)
开发者ID:kmshi,项目名称:miro,代码行数:51,代码来源:itemlistcontroller.py

示例5: test_default_column_widths

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_standard_view_type [as 别名]
    def test_default_column_widths(self):
        # test that all available columns have widths set for them

        # calculate all columns that available for some display/view
        # combination
        available_columns = set()
        display_id = None # this isn't used yet, just set it to a dummy value
        for display_type in self.display_types:
            for view_type in (WidgetStateStore.get_list_view_type(),
                            WidgetStateStore.get_standard_view_type(),
                            WidgetStateStore.get_album_view_type()):
                available_columns.update(
                        WidgetStateStore.get_columns_available(
                            display_type, display_id, view_type))

        # make sure that we have widths for those columns
        self.assertEqual(available_columns,
                set(WidgetStateStore.DEFAULT_COLUMN_WIDTHS.keys()))
开发者ID:CodeforEvolution,项目名称:miro,代码行数:20,代码来源:widgetstateconstantstest.py

示例6: test_view_types

# 需要导入模块: from miro.frontends.widgets.widgetstatestore import WidgetStateStore [as 别名]
# 或者: from miro.frontends.widgets.widgetstatestore.WidgetStateStore import get_standard_view_type [as 别名]
 def test_view_types(self):
     self.assertNotEqual(WidgetStateStore.get_list_view_type(),
                         WidgetStateStore.get_standard_view_type())
开发者ID:kmshi,项目名称:miro,代码行数:5,代码来源:widgetstateconstantstest.py


注:本文中的miro.frontends.widgets.widgetstatestore.WidgetStateStore.get_standard_view_type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。