def test_add_icons_10(self): controller = RecentIconsList(10, self.config, self.icons_path) controller.load() self._add_invalid_icons(controller, 2) icons_list = controller.getRecentIcons() controller2 = RecentIconsList(10, self.config, self.icons_path) controller2.load() icons_list2 = controller2.getRecentIcons() self.assertEqual(len(icons_list), 2) self.assertEqual(len(icons_list2), 0)
def test_add_icons_08(self): count = 10 controller = RecentIconsList(10, self.config, self.icons_path) controller.load() self._add_icons(controller, count) icons_list = controller.getRecentIcons() controller2 = RecentIconsList(10, self.config, self.icons_path) controller2.load() icons_list2 = controller2.getRecentIcons() self.assertEqual(icons_list, icons_list2)
def test_add_icons_09(self): controller = RecentIconsList(10, self.config, self.icons_path) controller.load() self._add_icons(controller, 2, 'xxx') self._add_icons(controller, 2, 'yyy') icons_list = controller.getRecentIcons() controller2 = RecentIconsList(10, self.config, self.icons_path) controller2.load() icons_list2 = controller2.getRecentIcons() self.assertEqual(len(icons_list), 4) self.assertEqual(icons_list, icons_list2)
def __init__(self, iconsPanel, application, dialog): super().__init__(application) self._dialog = dialog self._iconsPanel = iconsPanel self._groupsMaxWidth = 200 self._page = None self._default_group_cover = getBuiltinImagePath( 'icons_cover_default.png') self._default_icon_filename = os.path.abspath( os.path.join(getIconsDirList()[0], ICON_DEFAULT)) guiconfig = GeneralGuiConfig(application.config) self._recentIconsList = RecentIconsList( guiconfig.iconsHistoryLength.value, application.config, getIconsDirList()[0]) self._recentIconsList.load() self._iconsPanel.iconsList.Bind(EVT_ICON_SELECTED, handler=self._onIconSelected) self._iconsPanel.groupCtrl.Bind(EVT_SWITCH, handler=self._onGroupSelect) self._selectedIcon = self._default_icon_filename self._groupsInfo = self._getGroupsInfo() self._appendGroups() group_index = 0 if len(self._recentIconsList) else 1 self._iconsPanel.groupCtrl.SetSelection(group_index)
def test_add_icons_06_limit(self): count = 11 controller = RecentIconsList(10, self.config, self.icons_path) controller.load() self._add_icons(controller, count) icons_list = controller.getRecentIcons() self.assertEqual(len(icons_list), 10)
def __init__(self, iconsPanel, application, dialog): super(IconsController, self).__init__(application) self._dialog = dialog self._iconsPanel = iconsPanel self._groupsMaxWidth = 200 self._page = None self._default_group_cover = os.path.join(getImagesDir(), u'icons_cover_default.png') guiconfig = GeneralGuiConfig(application.config) self._recentIconsList = RecentIconsList( guiconfig.iconsHistoryLength.value, application.config, getIconsDirList()[0]) self._recentIconsList.load() self._iconsPanel.iconsList.Bind(EVT_ICON_SELECTED, handler=self._onIconSelected) self._iconsPanel.groupCtrl.Bind(EVT_SWITCH, handler=self._onGroupSelect) self._selectedIcon = None self._groupsInfo = self._getGroupsInfo() self._appendGroups() self._iconsPanel.groupCtrl.SetSelection(0) self._switchToCurrentGroup()
def __init__(self, iconsPanel, application, dialog): super(IconsController, self).__init__(application) self._dialog = dialog self._iconsPanel = iconsPanel self._groupsMaxWidth = 200 self._recentIconsList = RecentIconsList(RECENT_ICONS_COUNT, application.config, getIconsDirList()[0]) self._recentIconsList.load() self._iconsPanel.iconsList.Bind(EVT_ICON_SELECTED, handler=self._onIconSelected) self._iconsPanel.groupCtrl.Bind(EVT_SWITCH, handler=self._onGroupSelect) self._selectedIcon = None self._groupsInfo = self._getGroupsInfo() self._appendGroups() self._iconsPanel.groupCtrl.SetSelection(0) self._switchToCurrentGroup()
def test_empty_02(self): controller = RecentIconsList(10, self.config, self.icons_path) controller.load() icons_list = controller.getRecentIcons() self.assertEqual(icons_list, [])